/* Eleve Market design system — "Eleve 2", the family look shared with Eleve Social and Eleve Flow.
   One accent (Eleve Market blue, #0F4DF6 in the logo kit), a neutral screen, Schibsted Grotesk for titles, navigation and figures,
   Inter for text. Motion only answers the person and rests under prefers-reduced-motion. */

/* ---------- Fonts (self-hosted, OFL; licences next to the files) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin.aa029bd61127.woff2") format("woff2-variations"), url("fonts/inter-latin.aa029bd61127.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-ext.b6442d62f808.woff2") format("woff2-variations"), url("fonts/inter-latin-ext.b6442d62f808.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/schibsted-latin.ba4038fc5cb5.woff2") format("woff2-variations"), url("fonts/schibsted-latin.ba4038fc5cb5.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/schibsted-latin-ext.65233324c912.woff2") format("woff2-variations"), url("fonts/schibsted-latin-ext.65233324c912.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
/* "Eleve 3 Grafite": a dark theme (the default) and a light one with the same structure.
   Eleve blue is the colour of action; the blue-to-violet gradient marks only what the AI does. */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --bg-glow: radial-gradient(1100px 480px at 78% -14%, rgba(15, 77, 246, 0.08), transparent 62%);
  --sidebar: #fbfbfc;
  --card: #ffffff;
  --card-solid: #ffffff;
  --card-border: #e5e7eb;
  --surface-2: #ffffff;
  --ink: #12141a;
  --muted: #5b606b;
  --faint: #868b96;
  --line: #e5e7eb;
  --line-soft: #eef0f3;
  --hover: #f1f3f6;
  --primary: #0f4df6;
  --primary-hover: #0b3fd0;
  --on-primary: #ffffff;
  --soft: #eef3fe;
  --tint: #d9e4fd;
  --ai-grad: linear-gradient(90deg, #3d6bf0 0%, #7c5cf0 100%);
  --ai-soft: linear-gradient(100deg, rgba(61, 107, 240, 0.09), rgba(124, 92, 240, 0.05));
  --ai-line: rgba(92, 100, 240, 0.30);
  --ai-ink: #4c55d8;
  /* "ELEVE" in the logo: black on light, white on dark (the kit's positive and negative logos). */
  --logo-ink: #050505;
  --green: #12805a;
  --green-soft: #e3f4ec;
  --amber: #8f5d08;
  --amber-soft: #fcf0d9;
  --red: #c0313f;
  --red-soft: #fbe8ea;
  /* Chart palette, checked for lightness band, chroma, colour blindness and contrast. */
  --chart-1: #3d6bf0;
  --chart-1-soft: rgba(61, 107, 240, 0.14);
  --chart-2: #12805a;
  --chart-3: #c9850a;
  --chart-4: #c2417a;
  --chart-grid: #eceef1;
  --scrim: rgba(18, 20, 26, 0.36);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.03);
  --shadow-float: 0 16px 40px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.08);
  --shadow-lift: 0 10px 24px rgba(16, 24, 40, 0.08);
  --shadow-press: 0 1px 2px rgba(16, 24, 40, 0.10);

  --r-card: 16px;
  --r-ctl: 10px;
  --r-sm: 8px;
  --r-pill: 999px;

  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-title: "Schibsted Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
  --m-in: 150ms;
  --m-out: 120ms;
  --m-press: 90ms;

  --side-w: 252px;
  --side-rail: 72px;
  --top-h: 64px;
  --gut: 32px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0c0f;
  --bg-glow: radial-gradient(1100px 520px at 78% -16%, rgba(79, 123, 255, 0.20), transparent 62%);
  --sidebar: #0d0e12;
  --card: rgba(255, 255, 255, 0.035);
  --card-solid: #15171c;
  --card-border: rgba(255, 255, 255, 0.075);
  --surface-2: #1c1f26;
  --ink: #e9eaee;
  --muted: #a0a5b1;
  --faint: #7a7f8c;
  --line: rgba(255, 255, 255, 0.085);
  --line-soft: rgba(255, 255, 255, 0.05);
  --hover: rgba(255, 255, 255, 0.055);
  --primary: #5b86ff;
  --primary-hover: #7a9dff;
  --on-primary: #0a0f1f;
  --soft: rgba(91, 134, 255, 0.13);
  --tint: rgba(91, 134, 255, 0.26);
  --ai-grad: linear-gradient(90deg, #4f7bff 0%, #8b5cf6 100%);
  --ai-soft: linear-gradient(100deg, rgba(79, 123, 255, 0.15), rgba(139, 92, 246, 0.07));
  --ai-line: rgba(116, 134, 255, 0.30);
  --ai-ink: #aab9ff;
  --logo-ink: #ffffff;
  --green: #4fd39b;
  --green-soft: rgba(79, 211, 155, 0.12);
  --amber: #f3bd5c;
  --amber-soft: rgba(243, 189, 92, 0.12);
  --red: #f4808e;
  --red-soft: rgba(244, 128, 142, 0.12);
  --chart-1: #5b86ff;
  --chart-1-soft: rgba(91, 134, 255, 0.20);
  --chart-2: #4fd39b;
  --chart-3: #f3bd5c;
  --chart-4: #e277a8;
  --chart-grid: rgba(255, 255, 255, 0.06);
  --scrim: rgba(0, 0, 0, 0.56);
  --shadow-card: none;
  --shadow-float: 0 18px 44px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 10px 26px rgba(0, 0, 0, 0.45);
  --shadow-press: 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  background: var(--bg-glow), var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--ink);
  font: 400 14px/1.5 var(--font-text);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-title); color: var(--ink); margin: 0; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.028em; }
h2 { font-size: 17px; line-height: 1.3; font-weight: 650; letter-spacing: -0.012em; }
h3 { font-size: 15px; line-height: 1.35; font-weight: 650; letter-spacing: -0.006em; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--tint); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; }
.num, .figure { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.measure { max-width: 62ch; }

.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.i--sm { width: 16px; height: 16px; }
.i--lg { width: 22px; height: 22px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-ctl);
  padding: 10px 14px; font-weight: 600;
}
.skip-link:focus-visible { top: 12px; }

/* Links in running text draw their underline. */
.link {
  color: var(--primary);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size var(--m-out) var(--ease);
  padding-bottom: 1px;
}
.link:hover { background-size: 100% 1px; transition-duration: var(--m-in); }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
}
html[data-collapsed] .app { grid-template-columns: var(--side-rail) minmax(0, 1fr); }

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px 12px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  z-index: 40;
}
.side__top { display: flex; align-items: center; gap: 4px; padding: 0 0 10px; }

.brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  height: 40px; padding: 0 6px; border-radius: var(--r-sm);
  color: var(--ink); flex: 1;
}
/* The Eleve Market wordmark (sprite in panel/_brand.html) and, on the collapsed rail, the app icon. */
.brand-logo {
  display: block; flex: none; width: auto; height: 16px; aspect-ratio: 1385.5 / 143.5;
  color: var(--logo-ink); overflow: visible;
}
.brand-logo--lg { height: 24px; }
.brand-icon { display: none; flex: none; width: 32px; height: 32px; }

.shop-chip {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--card); color: var(--ink); min-width: 0;
}
.shop-chip:hover { border-color: color-mix(in srgb, var(--ink) 18%, var(--line)); }
.shop-chip__logo { width: 26px; height: 26px; border-radius: 7px; flex: none; }
.shop-chip__name { display: block; font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-chip__meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; line-height: 1.2; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot--green { background: var(--green); }
.dot--amber { background: var(--amber); }
.dot--red { background: var(--red); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 36px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--muted); font: 550 14.5px/1 var(--font-title); letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background-color var(--m-out) var(--ease), color var(--m-out) var(--ease);
}
.nav__item:hover { background: var(--hover); color: var(--ink); transition-duration: var(--m-in); }
.nav__item[aria-current="page"] { background: var(--soft); color: var(--primary); }
.nav__item .i { width: 19px; height: 19px; }
.nav__label { overflow: hidden; text-overflow: ellipsis; }
.nav__count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary);
  font: 650 12px/20px var(--font-title); text-align: center; font-variant-numeric: tabular-nums;
}
.nav__count--amber { background: var(--amber-soft); color: var(--amber); }

.nav-group { margin-top: 8px; }
.nav-group__toggle {
  width: 100%; display: flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 10px; border: 0; background: none; border-radius: var(--r-sm);
  color: var(--faint); font: 600 11.5px/1 var(--font-text); letter-spacing: 0.06em; text-transform: uppercase; text-align: left;
}
.nav-group__toggle:hover { color: var(--ink); }
.nav-group__toggle .i { width: 14px; height: 14px; margin-left: auto; transition: transform var(--m-out) var(--ease); }
.nav-group__toggle[aria-expanded="false"] .i { transform: rotate(-90deg); }
.nav-group__items[hidden] { display: none; }

.side__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.side__toggle {
  width: 36px; height: 36px; display: grid; place-items: center; flex: none;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--muted);
}
.side__toggle:hover { background: var(--hover); color: var(--ink); }
.nav__item--button { width: 100%; border: 0; background: none; text-align: left; }

.user {
  display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 6px 2px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--soft); color: var(--primary); font: 700 14px/1 var(--font-title);
}
.user__name { display: block; font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user__role { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; }
.user form { margin-left: auto; }

/* Collapsed rail */
html[data-collapsed] .side { padding-left: 10px; padding-right: 10px; }
html[data-collapsed] .brand-icon { display: block; }
html[data-collapsed] .brand-logo,
html[data-collapsed] .nav__label,
html[data-collapsed] .nav-group__toggle,
html[data-collapsed] .shop-chip__text,
html[data-collapsed] .user__text,
html[data-collapsed] .user form { display: none; }
html[data-collapsed] .side__top { flex-direction: column; gap: 8px; }
html[data-collapsed] .brand { padding: 0; justify-content: center; flex: none; }
html[data-collapsed] .nav__item { justify-content: center; padding: 0; }
html[data-collapsed] .nav__count {
  position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; line-height: 16px; font-size: 11px; padding: 0 4px;
}
html[data-collapsed] .nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
html[data-collapsed] .nav-group__items[hidden] { display: flex; }
html[data-collapsed] .shop-chip { justify-content: center; padding: 6px; }
html[data-collapsed] .user { justify-content: center; padding: 8px 0 2px; }

/* Main column */
.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  height: var(--top-h); padding: 0 var(--gut);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
.top.is-scrolled { border-bottom-color: var(--line); }
.top .top__menu { display: none; }
.top .top__brand { display: none; }
.top__spacer { flex: 1; }

.search {
  flex: 0 1 420px; height: 40px; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--card); color: var(--faint); text-align: left;
  transition: border-color var(--m-out) var(--ease);
}
.search:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); color: var(--muted); }
.search__text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd, .kbd {
  font: 600 11.5px/1 var(--font-text); color: var(--muted);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
  padding: 3px 6px; background: var(--surface-2);
}

.content {
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding: 12px var(--gut) 72px;
}

/* ---------- Page header ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin: 8px 0 24px;
}
.page-head__title { display: flex; align-items: center; gap: 10px; }
.page-head__lead { margin-top: 6px; font-size: 15px; color: var(--muted); max-width: 66ch; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Help: the round "i" beside a title */
.help { position: relative; }
.help > summary {
  list-style: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted);
  border: 1px solid var(--line); background: var(--card); cursor: pointer;
  transition: border-color var(--m-out) var(--ease), color var(--m-out) var(--ease);
}
.help > summary::-webkit-details-marker { display: none; }
.help > summary:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 28%, var(--line)); }
.help[open] > summary { color: var(--primary); border-color: var(--primary); }
.help__box {
  position: absolute; top: 38px; left: -12px; z-index: 50; width: min(420px, calc(100vw - 32px));
  padding: 18px 20px; border-radius: var(--r-card); border: 1px solid var(--line);
  background: var(--card-solid); box-shadow: var(--shadow-float);
  font: 400 14px/1.55 var(--font-text); color: var(--ink);
  animation: pop var(--m-in) var(--ease);
}
.help__box h2 { font-size: 16px; margin-bottom: 6px; }
.help__box ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.help__box .ai-note { margin-top: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 600 14px/1 var(--font-text); white-space: nowrap; text-decoration: none;
  transition:
    background-color var(--m-out) var(--ease), border-color var(--m-out) var(--ease),
    color var(--m-out) var(--ease), transform var(--m-press) var(--ease), box-shadow var(--m-out) var(--ease);
}
.btn:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); transition-duration: var(--m-in); }
.btn:active { transform: translateY(1px) scale(0.985); transition-duration: var(--m-press); }
.btn .i { width: 17px; height: 17px; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--hover); border-color: transparent; color: var(--ink); }
.btn--danger { color: var(--red); }
.btn--danger:hover { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); background: var(--red-soft); }
.btn--ai {
  border-color: transparent;
  background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, var(--ai-grad) border-box;
}
.btn--ai:hover { border-color: transparent; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.btn--ai .i { color: var(--ai-ink); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); gap: 6px; }
.btn--sm .i { width: 15px; height: 15px; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 40px; height: 40px; padding: 0; flex: none;
  display: inline-grid; place-items: center; position: relative;
  border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--muted);
  transition: background-color var(--m-out) var(--ease), color var(--m-out) var(--ease), transform var(--m-press) var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); transition-duration: var(--m-in); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn__dot {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: var(--r-pill); background: var(--red); color: #fff; box-sizing: border-box;
  font: 700 10.5px/14px var(--font-title); text-align: center; border: 2px solid var(--bg);
}
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; margin: 0; }

/* ---------- Cards and layout grids ---------- */
.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); min-width: 0;
}
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px 0;
}
.card__head--line { padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.card__title { font: 650 17px/1.3 var(--font-title); letter-spacing: -0.012em; display: flex; align-items: center; gap: 8px; }
.card__sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card__body { padding: 16px 20px 20px; }
.card__body--flush { padding: 8px 0 4px; }
.card__foot { padding: 12px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; align-items: center; justify-content: space-between; }
a.card, .card--link {
  display: block; color: inherit;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  a.card:hover, .card--link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--ink) 16%, var(--line)); }
}

/* One column that can shrink: a wide child (a table, a long word) scrolls or wraps inside it
   instead of widening the page. */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.stack--lg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 0 12px; }
.section-title h2 { font-size: 17px; }
.section-title a { font-weight: 600; font-size: 13px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.kpi__label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi__label .i { width: 16px; height: 16px; color: var(--faint); }
.kpi__value { font: 700 28px/1.05 var(--font-title); letter-spacing: -0.024em; white-space: nowrap; }
.kpi__value small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: -0.01em; margin-left: 2px; }
.kpi__meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi--amber .kpi__value { color: var(--amber); }
.kpi--red .kpi__value { color: var(--red); }
.kpi--green .kpi__value { color: var(--green); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta .i { width: 14px; height: 14px; }
.delta--up { color: var(--green); }
.delta--down { color: var(--red); }
.spark { width: 100%; height: 36px; margin-top: 2px; }

/* ---------- Badges, chips, dots ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  background: var(--hover); color: var(--muted);
  font: 600 12px/1 var(--font-text); white-space: nowrap;
}
.badge .i { width: 13px; height: 13px; }
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--amber { background: var(--amber-soft); color: var(--amber); }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--blue { background: var(--soft); color: var(--primary); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: var(--r-sm); background: var(--hover); color: var(--muted);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.chip .i { width: 14px; height: 14px; }
.chip--amber { background: var(--amber-soft); color: var(--amber); }
.chip--green { background: var(--green-soft); color: var(--green); }
.chip--blue { background: var(--soft); color: var(--primary); }
.chip--ai { background: var(--ai-soft); color: var(--ai-ink); box-shadow: inset 0 0 0 1px var(--ai-line); }

/* ---------- Tables and lists ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: left; font: 500 13px/1.2 var(--font-text); color: var(--muted);
  padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--m-out) var(--ease); }
.table tbody tr:hover { background: color-mix(in srgb, var(--hover) 70%, transparent); }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .num { text-align: right; white-space: nowrap; }
.table--compact td { padding-top: 9px; padding-bottom: 9px; }
.cell-main { font-weight: 550; color: var(--ink); }
.cell-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cell-flex { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-clip { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-wrap { max-width: 420px; overflow-wrap: anywhere; }
.thumb {
  width: 40px; height: 40px; flex: none; border-radius: var(--r-sm); object-fit: cover;
  background: var(--hover); border: 1px solid var(--line-soft);
}
.thumb--sm { width: 32px; height: 32px; border-radius: 7px; }
.thumb--empty { display: grid; place-items: center; color: var(--faint); }
.due { color: var(--red); font-weight: 600; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.rows > li:last-child { border-bottom: 0; }
.rows__main { flex: 1; min-width: 0; }
.rows__title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows__sub { font-size: 12.5px; color: var(--muted); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.toolbar__spacer { flex: 1; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; }
.pager__links { display: flex; gap: 8px; }

/* ---------- Segmented control and tabs ---------- */
.seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-ctl); background: var(--hover); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg a, .seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted);
  font: 550 13.5px/1 var(--font-text); white-space: nowrap;
  transition: background-color var(--m-out) var(--ease), color var(--m-out) var(--ease);
}
.seg a:hover, .seg button:hover { color: var(--ink); }
.seg [aria-current="page"], .seg [aria-pressed="true"], .seg .is-on { background: var(--surface-2); color: var(--ink); box-shadow: var(--shadow-press); }
.seg .count { font-variant-numeric: tabular-nums; color: var(--faint); font-weight: 600; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  color: var(--muted); font: 550 14px/1 var(--font-title); white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field__hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-ctl);
  background: var(--card); color: var(--ink); font: 400 14px/1.4 var(--font-text);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8d94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.textarea { height: auto; min-height: 104px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input--sm, .select--sm { height: 34px; font-size: 13.5px; border-radius: var(--r-sm); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .i { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.input-group .input { padding-left: 38px; }
.input-suffix { position: absolute; right: 12px; color: var(--muted); font-size: 13px; pointer-events: none; }
/* A field with a unit after it has no icon before it. */
.input-group--suffix .input { padding-left: 12px; padding-right: 40px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; align-items: end; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }

.drop {
  position: relative; display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: 24px 20px; border: 1.5px dashed var(--line); border-radius: var(--r-card);
  background: var(--bg); color: var(--muted); cursor: pointer;
  transition: border-color var(--m-out) var(--ease), background-color var(--m-out) var(--ease);
}
.drop:hover, .drop.is-over { border-color: var(--primary); background: var(--soft); }
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop__icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--primary); border: 1px solid var(--line); }
.drop__title { color: var(--ink); font-weight: 600; }
.drop__files { font-size: 12.5px; color: var(--ink); }
.drop:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Switch-like mode picker (Desligado / Só observa / Age) */
.modes { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-ctl); background: var(--hover); }
.modes label { position: relative; }
.modes input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.modes span {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--muted); font: 550 13.5px/1 var(--font-text); white-space: nowrap;
  transition: background-color var(--m-out) var(--ease), color var(--m-out) var(--ease);
}
.modes input:checked + span { background: var(--surface-2); color: var(--ink); box-shadow: var(--shadow-press); }
.modes input:checked + span[data-mode="act"] { color: var(--green); }
.modes input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Switch: a real checkbox drawn as a toggle. */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative; width: 38px; height: 22px; flex: none; border-radius: var(--r-pill);
  background: var(--line); transition: background var(--m-in) var(--ease), box-shadow var(--m-in) var(--ease);
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform var(--m-in) var(--ease);
}
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch--ai input:checked + .switch__track { background: var(--ai-grad); box-shadow: 0 0 16px color-mix(in srgb, #6f6bff 45%, transparent); }

/* ---------- AI surfaces ---------- */
.ai-card {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--ai-line); border-radius: var(--r-card);
}
.ai-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 140px; pointer-events: none;
  background: var(--ai-soft); -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}
.ai-card > * { position: relative; }
.ai-label {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ai-ink); font: 650 13px/1 var(--font-title); letter-spacing: 0;
}
.ai-label .i { width: 16px; height: 16px; }
.ai-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-ctl); background: var(--ai-soft); color: var(--ink);
  border: 1px solid var(--ai-line); font-size: 13.5px; line-height: 1.5;
}
.ai-note .i { color: var(--ai-ink); margin-top: 1px; }
.draft { border-style: dashed; border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); }

.brief { padding: 20px 22px 22px; display: grid; gap: 14px; }
.brief__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brief__headline { font: 700 22px/1.25 var(--font-title); letter-spacing: -0.02em; max-width: 46ch; }
.brief__summary { font-size: 15px; line-height: 1.6; color: var(--ink); max-width: 72ch; }
.brief__list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.brief__item {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  border-radius: var(--r-ctl); background: var(--bg); border: 1px solid var(--line-soft); color: var(--ink);
  transition: border-color var(--m-out) var(--ease), background-color var(--m-out) var(--ease);
}
a.brief__item:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); background: var(--soft); }
.brief__n {
  width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); font: 700 12px/1 var(--font-title); color: var(--primary);
}
.brief__item-title { font-weight: 600; }
.brief__item-text { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.brief__item .i { margin-left: auto; color: var(--faint); align-self: center; }
.brief__meta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Working state (AI or a job in progress) */
.working { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { border-radius: 6px; background: var(--hover); animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { 50% { opacity: 0.55; } }

/* ---------- Approvals ---------- */
.approvals { list-style: none; margin: 0; padding: 0; }
.approval {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 16px; align-items: start;
  padding: 18px 20px; border-bottom: 1px solid var(--line-soft);
}
.approval:last-child { border-bottom: 0; }
.approval__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--hover); color: var(--muted); }
.approval__icon--ai { background: var(--ai-soft); color: var(--ai-ink); box-shadow: inset 0 0 0 1px var(--ai-line); }
.approval__icon--money { background: var(--amber-soft); color: var(--amber); }
.approval__title { font: 600 15px/1.35 var(--font-text); color: var(--ink); }
.approval__why { margin-top: 4px; color: var(--muted); font-size: 13.5px; line-height: 1.55; max-width: 78ch; }
.approval__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.approval__actions { display: flex; gap: 8px; align-items: center; }
.approval__actions form { margin: 0; }

/* ---------- Empty states ---------- */
.empty { display: grid; justify-items: center; gap: 6px; padding: 40px 24px; text-align: center; color: var(--muted); }
.empty__icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); color: var(--faint); margin-bottom: 6px; }
.empty__icon--green { background: var(--green-soft); color: var(--green); }
.empty__title { font: 650 16px/1.3 var(--font-title); color: var(--ink); }
.empty__text { max-width: 52ch; font-size: 14px; }
.empty .btn { margin-top: 10px; }
.steps { list-style: none; counter-reset: step; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.steps li { counter-increment: step; display: flex; gap: 10px; align-items: flex-start; color: var(--ink); }
.steps li::before {
  content: counter(step); width: 22px; height: 22px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--soft); color: var(--primary);
  font: 700 12px/1 var(--font-title); margin-top: 1px;
}

/* ---------- Notices ---------- */
.notice {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 14px; line-height: 1.5;
}
.notice .i { margin-top: 1px; flex: none; }
.notice__body { flex: 1; min-width: 0; }
.notice__title { font-weight: 600; }
.notice--red { background: var(--red-soft); border-color: transparent; }
.notice--red .i { color: var(--red); }
.notice--amber { background: var(--amber-soft); border-color: transparent; }
.notice--amber .i { color: var(--amber); }
.notice--green { background: var(--green-soft); border-color: transparent; }
.notice--green .i { color: var(--green); }
.notice--blue { background: var(--soft); border-color: transparent; }
.notice--blue .i { color: var(--primary); }
.notice a { font-weight: 600; white-space: nowrap; }
.notices { display: grid; gap: 8px; }

/* Toasts (Django messages) */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  display: grid; gap: 8px; width: min(400px, calc(100vw - 32px));
}
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 14px 14px 14px 16px; border-radius: var(--r-ctl);
  background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow-float);
  color: var(--ink); font-size: 14px; line-height: 1.45;
  animation: toast-in 220ms var(--ease-enter);
}
.toast .i { margin-top: 1px; }
.toast--success .i { color: var(--green); }
.toast--error .i { color: var(--red); }
.toast--warning .i { color: var(--amber); }
.toast--info .i { color: var(--primary); }
.toast__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast__close { width: 28px; height: 28px; margin: -4px -4px 0 0; border: 0; background: none; color: var(--faint); border-radius: 6px; display: grid; place-items: center; }
.toast__close:hover { background: var(--hover); color: var(--ink); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 160ms var(--ease), transform 160ms var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Popovers, drawer, command palette ---------- */
.popover {
  position: absolute; z-index: 60; min-width: 300px; max-width: min(380px, calc(100vw - 24px));
  background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-float); animation: pop var(--m-in) var(--ease);
}
.popover[hidden] { display: none; }
.popover__head { padding: 14px 16px 10px; font: 650 15px/1.2 var(--font-title); border-bottom: 1px solid var(--line-soft); }
.popover__list { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow-y: auto; }
.popover__list li a, .popover__list li > div {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: var(--r-sm); color: var(--ink); font-size: 13.5px; line-height: 1.45;
}
.popover__list li a:hover { background: var(--hover); }
.popover__empty { padding: 18px 16px; color: var(--muted); font-size: 13.5px; }
.anchor { position: relative; }

.scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); animation: fade 160ms var(--ease); }
.scrim[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80;
  width: min(440px, 100vw); display: flex; flex-direction: column;
  background: var(--card-solid); border-left: 1px solid var(--line); box-shadow: var(--shadow-float);
  animation: drawer-in 220ms var(--ease-enter);
}
.drawer[hidden] { display: none; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }
.drawer__head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--line-soft); }
.drawer__title { font: 700 17px/1.2 var(--font-title); letter-spacing: -0.012em; flex: 1; display: flex; align-items: center; gap: 8px; }
.drawer__title .i { color: var(--primary); }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px 20px; display: grid; gap: 14px; align-content: start; }
.drawer__foot { padding: 14px 16px 16px; border-top: 1px solid var(--line-soft); display: grid; gap: 8px; }
.drawer__intro { color: var(--muted); font-size: 14px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestion {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: var(--r-pill); padding: 7px 12px; font-size: 13px; text-align: left;
  transition: border-color var(--m-out) var(--ease), background-color var(--m-out) var(--ease);
}
.suggestion:hover { border-color: var(--primary); background: var(--soft); }
.msg { display: grid; gap: 6px; }
.msg--me { justify-items: end; }
.msg__bubble { max-width: 88%; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--primary); color: var(--on-primary); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.msg__answer { padding: 14px 16px; border-radius: 14px 14px 14px 4px; background: var(--bg); border: 1px solid var(--line-soft); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.msg__answer p + p, .msg__answer p + ul, .msg__answer ul + p { margin-top: 8px; }
.msg__answer ul { margin: 6px 0 0; padding-left: 18px; }
.msg__answer--error { background: var(--red-soft); border-color: transparent; }
.msg__links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ask-form { display: flex; gap: 8px; align-items: flex-end; }
.ask-form .textarea { min-height: 44px; max-height: 160px; resize: none; }
.ask-form .btn { height: 44px; }
.drawer__note { font-size: 12px; color: var(--faint); }

dialog.cmdk {
  width: min(600px, calc(100vw - 24px)); max-height: min(520px, calc(100vh - 80px));
  margin: 12vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--card-solid); color: var(--ink); box-shadow: var(--shadow-float); overflow: hidden;
}
dialog.cmdk[open] { display: flex; flex-direction: column; animation: pop var(--m-in) var(--ease); }
dialog.cmdk::backdrop { background: var(--scrim); }
.cmdk__input-row { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); }
.cmdk__input-row .i { color: var(--faint); }
.cmdk__input { flex: 1; height: 54px; border: 0; background: transparent; font-size: 15px; color: var(--ink); }
.cmdk__input:focus { outline: none; }
.cmdk__list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.cmdk__group { padding: 10px 10px 6px; font-size: 12px; font-weight: 600; color: var(--faint); }
.cmdk__item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-sm); color: var(--ink); cursor: pointer; }
.cmdk__item .i { color: var(--muted); }
.cmdk__item[aria-selected="true"] { background: var(--soft); color: var(--primary); }
.cmdk__item[aria-selected="true"] .i { color: var(--primary); }
.cmdk__hint { margin-left: auto; font-size: 12px; color: var(--faint); }
.cmdk__foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--faint); }

/* ---------- Charts (server-rendered SVG) ---------- */
.chart { width: 100%; height: auto; overflow: visible; }
.chart text { font: 500 11.5px var(--font-text); fill: var(--faint); }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .bar { fill: var(--chart-1); transition: opacity var(--m-out) var(--ease); }
.chart .bar--soft { fill: var(--chart-1-soft); }
.chart .bar--muted { fill: var(--line); }
.chart .line { fill: none; stroke: var(--chart-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line--blue { stroke: var(--chart-1); }
.chart .area { fill: var(--chart-1-soft); }
.chart .stop-top { stop-color: var(--chart-1); stop-opacity: 0.32; }
.chart .stop-end { stop-color: var(--chart-1); stop-opacity: 0; }
.chart .line--prev { stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .line--partial { stroke: var(--chart-1); stroke-width: 2; stroke-dasharray: 3 4; opacity: 0.8; }
.chart .pt--quiet { opacity: 0; transition: opacity var(--m-in) var(--ease); }
.chart .col:hover .pt--quiet, .chart .col:focus-visible .pt--quiet { opacity: 1; }
.chart .pt { fill: var(--chart-2); stroke: var(--card); stroke-width: 2; }
.chart .direct { fill: var(--muted); font-weight: 600; }
.chart .hit { fill: transparent; }
.chart-wrap { position: relative; }
.chart-wrap:hover .bar { opacity: 0.55; }
.chart-wrap .col:hover .bar { opacity: 1; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--chart-1); display: inline-block; }
.chart-legend i.l2 { height: 3px; border-radius: 2px; background: var(--chart-2); }
.chart-legend i.l3 { background: var(--chart-3); }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 150px;
  padding: 10px 12px; border-radius: var(--r-ctl); background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-float); font-size: 12.5px; line-height: 1.5; color: var(--ink);
  transform: translate(-50%, calc(-100% - 10px));
}
.chart-tip[hidden] { display: none; }
.chart-tip b { font-family: var(--font-title); font-weight: 650; }

.meter { position: relative; height: 8px; border-radius: var(--r-pill); background: var(--hover); overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--primary); }
.meter--green > span { background: var(--green); }
.meter--amber > span { background: var(--amber); }
.meter--red > span { background: var(--red); }

/* ROAS against break-even: one bar, a tick at break-even */
.roas { display: grid; gap: 4px; min-width: 120px; }
.roas__track { position: relative; height: 6px; border-radius: var(--r-pill); background: var(--hover); }
.roas__fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--green); }
.roas__fill--bad { background: var(--red); }
.roas__tick { position: absolute; top: -3px; width: 2px; height: 12px; border-radius: 1px; background: var(--ink); opacity: 0.55; }
.roas__label { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Steps of the fulfilment flow */
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.flow__step { position: relative; padding: 18px 20px; border-right: 1px solid var(--line-soft); }
.flow__step:last-child { border-right: 0; }
.flow__n { font: 700 30px/1 var(--font-title); letter-spacing: -0.02em; }
.flow__label { margin-top: 6px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.flow__step--alert .flow__n { color: var(--red); }
.flow__step--warn .flow__n { color: var(--amber); }

/* Pilot status */
.pilot { display: flex; align-items: center; gap: 14px; }
.pilot__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--primary); flex: none; }
.pilot__icon--off { background: var(--hover); color: var(--muted); }
.pilot__icon--act { background: var(--green-soft); color: var(--green); }
.pilot__title { font: 650 16px/1.3 var(--font-title); }
.pilot__text { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.limit { padding: 12px 14px; border-radius: var(--r-ctl); background: var(--bg); border: 1px solid var(--line-soft); }
.limit__label { font-size: 12.5px; color: var(--muted); }
.limit__value { font: 700 18px/1.2 var(--font-title); margin-top: 4px; letter-spacing: -0.01em; }

/* Timeline (activity) */
.timeline { list-style: none; margin: 0; padding: 4px 20px 8px; }
.timeline li { position: relative; display: flex; gap: 12px; padding: 10px 0; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 36px; bottom: -6px; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline__icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); color: var(--muted); flex: none; position: relative; }
.timeline__icon .i { width: 15px; height: 15px; }
.timeline__icon--green { background: var(--green-soft); color: var(--green); }
.timeline__icon--amber { background: var(--amber-soft); color: var(--amber); }
.timeline__icon--red { background: var(--red-soft); color: var(--red); }
.timeline__icon--blue { background: var(--soft); color: var(--primary); }
.timeline__text { font-size: 13.5px; line-height: 1.5; }
.timeline__when { font-size: 12px; color: var(--muted); }

/* Greeting block on Início */
.hello { margin: 8px 0 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hello__date { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.hello__lead { margin-top: 6px; font-size: 15px; color: var(--muted); }

.enter { animation: enter 520ms var(--ease-enter) both; animation-delay: calc(var(--d, 0) * 70ms); }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); background: var(--card); }
.auth__form { display: flex; flex-direction: column; justify-content: space-between; padding: 32px 48px; }
.auth__brand { flex: none; align-self: flex-start; padding: 0; height: 44px; }
.auth__box { width: 100%; max-width: 380px; margin: auto; display: grid; gap: 24px; padding: 32px 0; }
.auth__box h1 { font-size: 30px; }
.auth__lead { color: var(--muted); font-size: 15px; margin-top: 8px; }
.auth__fields { display: grid; gap: 16px; }
.auth__foot { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth__show { position: relative; background: var(--bg); border-left: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 48px 56px; gap: 28px; }
.auth__claim { max-width: 520px; }
.auth__claim h2 { font: 700 30px/1.15 var(--font-title); letter-spacing: -0.026em; }
.auth__claim p { margin-top: 10px; font-size: 15px; color: var(--muted); max-width: 52ch; }
.auth__window {
  border-radius: 18px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-float);
  overflow: hidden; max-width: 640px; animation: enter 900ms var(--ease-enter) both; animation-delay: 120ms;
}
.auth__window-bar { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line-soft); background: var(--sidebar); }
.auth__window-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: inline-block; }
.auth__window-body { padding: 18px; display: grid; gap: 12px; }
.auth__mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.auth__mini-kpis .kpi { padding: 12px 14px; gap: 4px; }
.auth__mini-kpis .kpi__value { font-size: 20px; }
.auth__mini-kpis .kpi__label { font-size: 12px; }
.auth__error { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  :root { --gut: 24px; }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__show { display: none; }
}
@media (max-width: 1023px) {
  .app, html[data-collapsed] .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw);
    transform: translateX(-100%); transition: transform 220ms var(--ease-enter);
    box-shadow: var(--shadow-float);
    visibility: hidden;
  }
  html[data-nav-open] .side { transform: none; visibility: visible; }
  html[data-collapsed] .side { padding-left: 12px; padding-right: 12px; }
  html[data-collapsed] .nav__label, html[data-collapsed] .nav-group__toggle,
  html[data-collapsed] .shop-chip__text, html[data-collapsed] .user__text, html[data-collapsed] .user form { display: revert; }
  html[data-collapsed] .brand-logo { display: block; }
  html[data-collapsed] .brand-icon { display: none; }
  html[data-collapsed] .nav__item { justify-content: flex-start; padding: 0 10px; }
  html[data-collapsed] .side__top { flex-direction: row; }
  .side__toggle--rail { display: none; }
  .top .top__menu { display: inline-grid; }
  .top .top__brand { display: flex; }
  .top__brand .brand-logo { height: 15px; }
  .search { flex: 1 1 auto; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow__step:nth-child(2) { border-right: 0; }
  .flow__step:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
}
@media (max-width: 720px) {
  :root { --gut: 16px; --top-h: 56px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .page-head { flex-direction: column; align-items: stretch; gap: 16px; }
  .page-actions { justify-content: flex-start; }
  .page-actions .btn { flex: 1 1 auto; }
  h1 { font-size: 24px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px 16px; }
  .kpi__value { font-size: 22px; }
  .approval { grid-template-columns: 36px minmax(0, 1fr); }
  .approval__icon { width: 36px; height: 36px; }
  .approval__actions { grid-column: 1 / -1; }
  .approval__actions .btn, .approval__actions form { flex: 1; }
  .approval__actions form .btn { width: 100%; }
  .search__text, .search kbd { display: none; }
  .search { flex: 0 0 40px; width: 40px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .top .btn--ai span { display: none; }
  .top .btn--ai { width: 40px; padding: 0; }
  .toasts { right: 16px; left: 16px; width: auto; bottom: 16px; }
  .auth__form { padding: 24px 20px; }
  .brief__headline { font-size: 19px; }
  .card__head { padding: 16px 16px 0; }
  .card__body { padding: 14px 16px 16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .rows > li { padding: 12px 16px; }
  .toolbar { padding: 12px 16px; }
  .icon-btn, .btn--sm { min-height: 40px; }
}
@media (pointer: coarse) {
  .btn { height: 44px; }
  .btn--sm { height: 40px; }
  .nav__item { height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
  .spin { animation: none !important; }
}

@media print {
  .side, .top, .toasts, .drawer, .page-actions { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .card { border-color: #ccc; break-inside: avoid; }
}

/* Two-by-two figures inside the main column of a split screen. */
.kpis--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dl { margin: 0; display: grid; }
.dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; text-align: right; }

/* Part-to-whole bar: one row, 2px surface gaps, rounded outer ends; the legend carries names and values. */
.split { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; }
.split > span { display: block; min-width: 3px; height: 100%; }
.split .k-shopee, .legend .k-shopee { background: var(--chart-3); }
.split .k-tax, .legend .k-tax { background: var(--chart-4); }
.split .k-cost, .legend .k-cost { background: var(--chart-1); }
.split .k-margin, .legend .k-margin { background: var(--chart-2); }
.legend { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 2px; }
.legend li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.legend li:last-child { border-bottom: 0; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .legend__value { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend .legend__pct { width: 56px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.numbers > summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 13px; list-style: none; display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; }
.numbers > summary::-webkit-details-marker { display: none; }
.numbers[open] > summary .i { transform: rotate(180deg); }
.numbers .table { margin-top: 8px; }

/* Fixes from the screenshot pass. */
.brief__item-title, .brief__item-text { display: block; }
.meter { display: block; }
.chart .direct { paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.top .top__brand { flex: none; }
@media (max-width: 720px) {
  .limits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { color: var(--muted); }
}

/* ---------- Product page ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
/* A figure card that is a link keeps the column of a figure card ("a.card" would make it a block). */
a.card.kpi { display: flex; }
.textarea--title { min-height: 0; resize: none; font-weight: 550; }
.cell-link { color: inherit; text-decoration: none; }
.cell-link:hover { color: var(--primary); }
.product-title { font-size: 24px; line-height: 1.25; max-width: 44ch; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.product-meta { margin-top: 8px; display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.hero { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.hero__side { display: grid; gap: 16px; min-width: 0; }
.hero__kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery { padding: 12px; display: grid; gap: 10px; }
.gallery__main { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: var(--r-ctl); background: var(--hover); display: block; }
.gallery__main--empty { display: grid; place-items: center; align-content: center; gap: 8px; color: var(--faint); font-size: 13px; }
.gallery__thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.gallery__thumb { flex: none; width: 56px; height: 56px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--hover); cursor: pointer; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__thumb[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--tint); }
.kpi__spark { display: block; height: 36px; }
.kpi__spark .spark { width: 100%; height: 36px; }
.product-tabs { margin-top: 24px; display: grid; gap: 16px; }
.product-tabs > .seg { justify-self: start; }
.product-tabs [data-tab-panel][hidden] { display: none; }
.counter { display: flex; justify-content: space-between; gap: 12px; }
.counter__n { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.counter__n--ok { color: var(--green); }
.counter__n--warn { color: var(--amber); }
.compare { display: grid; gap: 8px; justify-items: start; }
.compare__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; font-size: 12.5px; }
.compare__text { width: 100%; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--card); border: 1px solid var(--tint); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.compare__text--long { max-height: 280px; overflow-y: auto; }
.input--num { width: 112px; text-align: right; font-variant-numeric: tabular-nums; }
.input.is-changed, .textarea.is-changed { border-color: var(--primary); background: var(--soft); }
.fill { justify-content: flex-end; }
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
  .hero__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .gallery__main { max-height: 320px; }
  .product-title { font-size: 20px; }
  .input--num { width: 92px; }
}

/* ---------- New listing: starting points, paste box, draft editor ---------- */
.start { padding: 20px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 16px; align-items: start; }
.start__icon { width: 40px; height: 40px; }
.start__text .card__sub { margin-top: 4px; font-size: 13.5px; line-height: 1.5; }
.start > .btn, .start__form { grid-column: 2; justify-self: start; }
.start__form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; max-width: 100%; }
.start__form .select { max-width: 340px; min-width: 0; }
.paste { min-height: 200px; font-size: 13px; line-height: 1.45; }
.paste__found { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.paste__found img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--hover); display: block; }
.how { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.how li { display: flex; gap: 12px; align-items: flex-start; }
.how__n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--primary); font: 700 13px/1 var(--font-title); }
.how__title { font-weight: 600; font-size: 14px; }
.how__text { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.photo { position: relative; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; background: var(--card); opacity: 0.55; transition: opacity 150ms var(--ease), border-color 150ms var(--ease); }
.photo.is-on { opacity: 1; border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.photo img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--hover); }
.photo__cover { display: none; position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); font: 650 11px/1.2 var(--font-title); }
.photo.is-cover .photo__cover { display: block; }
.photo[draggable="true"] { cursor: grab; }
.photo.is-dragging { opacity: 0.35; outline: 2px dashed var(--primary); outline-offset: 2px; }
.photo__bar { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 6px; border-top: 1px solid var(--line-soft); }
.photo__move { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; }
.photo__move:hover { background: var(--hover); color: var(--ink); }
.photo__use { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tiers { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2.4fr); gap: 12px 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; cursor: pointer; }
.check input { margin-top: 2px; flex: none; }
@media (max-width: 720px) {
  .start { grid-template-columns: 1fr; }
  .start > .btn, .start__form { grid-column: 1; }
  .tiers { grid-template-columns: 1fr; }
  .photos { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

/* ---------- Ads overview ---------- */
.chart .line--spend { stroke: var(--chart-3); }
.chart .pt--spend { fill: var(--chart-3); }
.chart .pt--blue { fill: var(--chart-1); }
.chart .ref { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 4; }
/* A day the pilot changed something: a mark on top and a thin dashed line down. */
.chart .mark { fill: var(--ink); }
.chart .mark-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.7; }
.chart-legend i.l-mark { width: 0; height: 0; border-radius: 0; background: none; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--ink); }
.chart .col { outline: none; }
.chart .col:focus-visible .hit { fill: var(--chart-1-soft); }
.chart-legend i.l-spend { height: 3px; border-radius: 2px; background: var(--chart-3); }
.ads-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ads-kpis .kpi { padding: 16px 16px; }
.ads-kpis .kpi__value { font-size: 24px; }
.funnel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.funnel__step { position: relative; padding: 16px 20px; border-right: 1px solid var(--line-soft); }
.funnel__step:last-child { border-right: 0; }
.funnel__n { font: 700 24px/1.1 var(--font-title); letter-spacing: -0.02em; }
.funnel__label { margin-top: 4px; font-size: 13px; color: var(--muted); }
.funnel__rate { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.funnel__rate b { color: var(--ink); font-weight: 650; }
.spark-cell .spark { width: 96px; height: 28px; }
.table--ads td:first-child { min-width: 230px; }
.ads-kpis .kpi__label { white-space: nowrap; }
.profit--bad { color: var(--red); font-weight: 600; }
.profit--good { color: var(--green); font-weight: 600; }
@media (max-width: 1280px) {
  .ads-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.approval__meta .chip { max-width: 100%; height: auto; min-height: 26px; padding-block: 4px; white-space: normal; text-align: left; }
@media (max-width: 720px) {
  .ads-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ads-kpis .kpi__label { white-space: normal; }
  .funnel { grid-template-columns: 1fr; }
  .funnel__step { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .funnel__step:last-child { border-bottom: 0; }
}

/* ---------- Photo studio ---------- */
.pick { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.pick > legend { padding: 0; margin-bottom: 2px; }
.pick__photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.pick__photo { position: relative; border: 2px solid transparent; border-radius: var(--r-ctl); overflow: hidden; cursor: pointer; background: var(--hover); outline: 1px solid var(--line); outline-offset: -1px; }
.pick__photo img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pick__photo:has(input:checked) { border-color: var(--primary); outline-color: transparent; }
.pick__photo:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--tint); }
.pick__tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.pick__tool { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); cursor: pointer; background: var(--card); transition: border-color 150ms var(--ease), background 150ms var(--ease); }
.pick__tool:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }
.pick__tool:has(input:checked) { border-color: var(--primary); background: var(--soft); }
.pick__tool:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--tint); }
.pick__tool-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; }
.pick__tool-name { font-weight: 650; font-size: 14px; color: var(--ink); }
.pick__tool-hint { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.pick.is-idle { opacity: 0.55; }
.results { list-style: none; margin: 0; padding: 0; }
.result { display: grid; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.result:last-child { border-bottom: 0; }
.result__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.result__pair figure { margin: 0; display: grid; gap: 4px; }
.result__pair img, .result__wait { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--hover); display: block; }
.result__pair figcaption { font-size: 12px; color: var(--muted); }
.result__wait--failed { display: grid; place-items: center; color: var(--red); }
.result__body { display: grid; gap: 8px; justify-items: start; }

/* ---------- First steps (home) ---------- */
.steps-card__meter { width: 160px; flex: none; }
.steps-card .rows > li { align-items: flex-start; }
.steps-card .rows .btn { flex: none; }
@media (max-width: 720px) {
  .steps-card__meter { display: none; }
  .steps-card .rows > li { flex-wrap: wrap; }
  .steps-card .rows .btn { margin-left: 40px; }
}

/* ---------- Price simulator ---------- */
.sim { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.sim__result { display: grid; gap: 14px; padding: 16px; border-radius: var(--r-ctl); background: var(--hover); min-height: 180px; align-content: start; }
.sim__headline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sim__margin { font: 700 30px/1.05 var(--font-title); letter-spacing: -0.024em; }
.sim__margin--bad { color: var(--red); }
.sim__margin--good { color: var(--green); }
.sim__split { height: 16px; }
.sim__rows { display: grid; gap: 0; margin: 0; }
.sim__rows > div { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.sim__rows > div:last-child { border-bottom: 0; }
.sim__rows dt { display: flex; flex-direction: column; }
.sim__rows dt span { font-size: 12px; color: var(--muted); }
.sim__rows dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.sim__dot { width: 10px; height: 10px; border-radius: 3px; align-self: center; }
.sim__dot.k-shopee { background: var(--chart-3); }
.sim__dot.k-tax { background: var(--chart-4); }
.sim__dot.k-cost { background: var(--chart-1); }
.sim__dot.k-margin { background: var(--chart-2); }
.sim__facts { display: grid; gap: 8px; font-size: 13.5px; line-height: 1.5; }
.sim__facts b { font-weight: 650; }
@media (max-width: 1023px) {
  .sim { grid-template-columns: 1fr; }
}

/* ---------- Buyer reviews ---------- */
.reviews-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.reviews-kpis--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1280px) { .reviews-kpis--five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stars-spread { display: grid; gap: 5px; }
.stars-spread__row { display: grid; grid-template-columns: 10px minmax(0, 1fr) 34px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.stars-spread__row .num { text-align: right; font-variant-numeric: tabular-nums; }
.stars-spread .meter { height: 6px; }
.reviews { list-style: none; margin: 0; padding: 0; }
.review { display: grid; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 80px; }
.review:last-child { border-bottom: 0; }
.review__head { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; font-size: 13px; }
.review__text { font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; max-width: 80ch; }
.review__reply { padding: 10px 14px; border-left: 3px solid var(--tint); background: var(--soft); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; font-size: 14px; line-height: 1.5; max-width: 80ch; display: grid; gap: 2px; }
.review__form { display: grid; gap: 8px; max-width: 80ch; }
.review__form .textarea { min-height: 76px; }
.stars { display: inline-flex; gap: 1px; color: var(--line); }
.stars .is-on { color: var(--chart-3); fill: currentColor; }
.stars--1 .is-on, .stars--2 .is-on { color: var(--red); }
@media (max-width: 1100px) {
  .reviews-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The menu grew: its sections scroll on a short screen, and the account stays in view. */
.side > nav.nav { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; }
.side > nav.nav > *, .side__foot { flex: none; }

/* ---------- Bulk actions on a list ---------- */
.bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 20px; background: var(--soft); border-bottom: 1px solid var(--tint); }
.bulk[hidden] { display: none; }
.bulk__count { font-size: 13.5px; }
.check-col { width: 36px; padding-right: 0 !important; }
.select--sm { height: 34px; font-size: 13px; padding-top: 0; padding-bottom: 0; }

/* ---------- Attribute fields ---------- */
.attrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; align-items: start; }
.attrs__typed { display: flex; gap: 8px; }
.attrs__typed .input { flex: 1; min-width: 0; }
.attrs__typed .select { width: 136px; flex: none; }
.attrs__choices { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; padding: 2px; }
.attrs__choice { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: 13px; cursor: pointer; background: var(--card); }
.attrs__choice:has(input:checked) { border-color: var(--primary); background: var(--soft); }

.timeline__effect { font-size: 13px; color: var(--muted); margin-top: 2px; }
.timeline__effect b { color: var(--ink); font-weight: 650; }

/* ---------- Returns ---------- */
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bar-list__row { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 34px; gap: 12px; align-items: center; font-size: 13.5px; }
.bar-list__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list__n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.returns__said { max-width: 46ch; white-space: normal; overflow-wrap: anywhere; font-style: italic; }
@media (max-width: 700px) {
  .bar-list__row { grid-template-columns: minmax(0, 120px) minmax(0, 1fr) 30px; }
}

/* ---------- When buyers buy: day of the week by hour ---------- */
.chart--hours .cell { fill: var(--chart-1); outline: none; }
.chart--hours .cell--zero { fill: var(--hover); }
.chart--hours .cell:hover, .chart--hours .cell:focus-visible { stroke: var(--ink); stroke-width: 1.5; }
.scale { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.scale i { width: 14px; height: 14px; border-radius: 4px; background: var(--chart-1); }
.hours__read { font-size: 14.5px; line-height: 1.55; max-width: 72ch; margin-bottom: 14px; }
.hours__read b { font-weight: 650; }

/* ---------- Phones: a card's actions drop under its title when there is no room beside it.
   (Lists stop being tables on a phone: see "Phones: lists" at the end.) ---------- */
@media (max-width: 720px) {
  .card__head { flex-wrap: wrap; }
  .card__head > div:first-child { flex: 1 1 220px; min-width: 0; }
  .card__head > .btn-row, .card__head > form { flex: 0 1 auto; }
  .section-title { flex-wrap: wrap; }
}

/* ---------- Home: reports ---------- */
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.home-head { align-items: flex-end; }
.needs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -8px 0 16px; }
.needs__label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-right: 4px; }
.needs__item {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border-radius: var(--r-pill); border: 1px solid var(--card-border); background: var(--card);
  color: var(--ink); font-size: 13.5px; transition: border-color var(--m-out) var(--ease);
}
.needs__item:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }
.needs__item .i { width: 16px; height: 16px; color: var(--muted); }
.needs__item strong { font: 700 14px/1 var(--font-title); }
.needs__item--red .i, .needs__item--red strong { color: var(--red); }
.needs__item--amber .i, .needs__item--amber strong { color: var(--amber); }
.needs__item--blue .i, .needs__item--blue strong { color: var(--primary); }
.home-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reading { display: grid; gap: 16px; padding: 20px 22px; align-content: start; }
.reading__body { display: grid; gap: 10px; }
.reading__body p { font-size: 15px; line-height: 1.6; color: var(--ink); max-width: 70ch; }
.reading__body .reading__lead { font: 650 19px/1.4 var(--font-title); letter-spacing: -0.012em; }
.reading__brief { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.reading__headline { font-weight: 600; }
.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ranking__row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; margin: 0 -8px; border-radius: var(--r-sm); color: var(--ink); }
.ranking__row:hover { background: var(--hover); }
.ranking__main { display: grid; gap: 6px; min-width: 0; }
.ranking__name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking__bar { height: 6px; border-radius: var(--r-pill); background: var(--line-soft); overflow: hidden; }
.ranking__bar span { display: block; height: 100%; border-radius: inherit; background: var(--chart-1); }
.ranking__figure { display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; }
.ranking__figure strong { font: 700 15px/1 var(--font-title); }
.ranking__figure span { font-size: 12px; color: var(--muted); }
.ranking__notes { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.ranking__note { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); }
.ranking__note:hover span:last-child { text-decoration: underline; }
.mini-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-kpis > * { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--hover); color: var(--ink); }
.mini-kpis a:hover { box-shadow: inset 0 0 0 1px var(--line); }
.mini-kpis strong { font: 700 22px/1.1 var(--font-title); letter-spacing: -0.02em; }
.mini-kpis .label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.mini-kpis span:last-child:not(.label) { font-size: 12.5px; }
.chart-legend i.l-prev { height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--faint); }
@media (max-width: 1100px) {
  .home-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .home-kpis, .mini-kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .home-head { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ---------- Reviews answered by the AI ---------- */
.auto-card { margin-bottom: 16px; position: relative; overflow: hidden; }
.auto-card.is-on { border-color: var(--ai-line); }
.auto-card.is-on::before { content: ""; position: absolute; inset: 0; background: var(--ai-soft); pointer-events: none; }
.auto-card > * { position: relative; }
.auto-card__row { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.auto-card__icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--ai-soft); color: var(--ai-ink); box-shadow: inset 0 0 0 1px var(--ai-line); }
.auto-card__text { flex: 1; min-width: 0; }
.auto-card__title { font: 650 16px/1.3 var(--font-title); }
.auto-card__sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; max-width: 80ch; }
.auto-card__note { display: flex; align-items: center; gap: 8px; padding: 0 20px 16px 76px; font-size: 13px; color: var(--muted); }
.switch--button { border: 0; background: none; padding: 6px 4px; color: var(--ink); font: 600 13.5px/1 var(--font-text); }
.switch--button[aria-checked="true"] .switch__track { background: var(--ai-grad); box-shadow: 0 0 16px color-mix(in srgb, #6f6bff 45%, transparent); }
.switch--button[aria-checked="true"] .switch__track::after { transform: translateX(16px); }
.switch--button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-sm); }
.review__reply--ai { background: var(--ai-soft); border: 1px solid var(--ai-line); }
.review__reply--ai .label { display: inline-flex; align-items: center; gap: 6px; color: var(--ai-ink); }
@media (max-width: 720px) {
  .auto-card__row { flex-wrap: wrap; }
  .auto-card__note { padding-left: 20px; }
}

/* ---------- The AI's memory: lessons and notes ---------- */
.memory { display: grid; gap: 12px; }
.memory__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.memory__item { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.5; }
.memory__item .badge { flex: none; margin-top: 1px; }
.memory__item--note { align-items: center; }
.memory__item--note > .i { color: var(--ai-ink); flex: none; }
.memory__item--note form { margin-left: auto; }
.memory__form { display: flex; gap: 8px; align-items: center; }
.memory__form .input { flex: 1; min-width: 0; }

/* ---------- "O que é isso?" and the mode badge ---------- */
.term {
  display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 4px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--faint);
  font: 700 11px/1 var(--font-text); vertical-align: middle; cursor: help;
}
.term:hover, .term:focus-visible { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.term__box {
  max-width: min(360px, calc(100vw - 32px)); padding: 16px 18px; margin: auto;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card-solid);
  color: var(--ink); box-shadow: var(--shadow-float); font: 400 14px/1.55 var(--font-text);
  letter-spacing: 0; text-transform: none; white-space: normal; text-align: left;
}
.term__box strong { display: block; font: 650 15px/1.3 var(--font-title); margin-bottom: 6px; }
.term__box::backdrop { background: color-mix(in srgb, var(--scrim) 60%, transparent); }
.mode-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--muted);
  font: 600 12.5px/1 var(--font-text); white-space: nowrap;
}
.mode-pill:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 24%, var(--line)); }
@media (max-width: 720px) { .top .mode-pill span { display: none; } }

/* ---------- Long pages in tabs ---------- */
.promo-tabs__bar, .ads-tabs__bar { margin: 24px 0 4px; }
.promo-tabs [data-tab-panel] > .section-title:first-child, .ads-tabs [data-tab-panel] > .section-title:first-child { margin-top: 16px; }

/* ---------- Approvals by area ---------- */
.approvals-group h2 { display: inline-flex; align-items: center; gap: 8px; }
.approvals-group h2 .i { color: var(--muted); }
.approvals-group .count { font: 600 13px/1 var(--font-text); color: var(--faint); }
.approvals-group:first-of-type { margin-top: 8px; }

/* ---------- Promotion ideas from the AI ---------- */
.ideas { margin-bottom: 16px; }
.ideas__mark { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 8px; background: var(--ai-grad); color: #fff; vertical-align: -6px; }
.ideas__mark .i { width: 15px; height: 15px; }
.idea__label { margin: 0 0 2px; font: 600 12px/1.3 var(--font-text); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.idea__by { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink); }
.idea__numbers { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.idea__numbers li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font: 500 13px/1.4 var(--font-text); color: var(--ink); background: var(--card); }
.idea__warn { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; font-size: 13px; color: var(--amber, #b45309); }
.empty--compact { padding: 28px 24px; }

/* ---------- Flash sales tab ---------- */
.tab-intro { margin: -4px 0 16px; max-width: 72ch; color: var(--muted); font-size: 14px; line-height: 1.55; }
.flash-days { margin: 0; padding: 0; list-style: none; }
.flash-day { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px 20px; border-top: 1px solid var(--line); }
.flash-day:first-child { border-top: 0; }
.flash-day__date { display: grid; justify-items: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 12px; }
.flash-day__date strong { font: 700 17px/1.2 var(--font-display); color: var(--ink); }
.flash-day__date span { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.flash-day__line { margin: 2px 0 0; font-size: 14px; color: var(--ink); }
.flash-day__error { margin: 6px 0 0; font-size: 13px; color: var(--red); }
details.more { margin-top: 10px; }
details.more > summary { cursor: pointer; width: fit-content; font-size: 13px; font-weight: 600; color: var(--primary); list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }
details.more[open] > summary { margin-bottom: 10px; }
.flash-auto { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.flash-auto__title { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; color: var(--ink); }
.flash-auto__text { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
@media (max-width: 640px) {
  .flash-day { grid-template-columns: 52px minmax(0, 1fr); }
  .flash-day > form { grid-column: 2; }
}

/* ---------- Account health in plain words ---------- */
.health-list { display: grid; gap: 10px; margin: 6px 0 0; padding: 0; list-style: none; }
.health-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.health-row--miss { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); background: color-mix(in srgb, var(--amber) 7%, transparent); }
.health-row__icon { color: var(--amber); padding-top: 1px; }
.health-row--near .health-row__icon { color: var(--muted); }
.health-row__title { margin: 0; font-size: 14px; color: var(--ink); }
.health-row__value { font-weight: 700; color: var(--amber); }
.health-row--near .health-row__value { color: var(--ink); }
.health-row__text { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.health-row__text strong { color: var(--ink); }
.health-row__note { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 13px; color: var(--ink); }

/* ---------- Phone and tablet shell (the Eleve Social way) ---------- */
.only-drawer { display: none; }
.nav__item--button { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.mode-pill--side { margin: 0 2px 8px; white-space: normal; line-height: 1.35; padding: 8px 12px; height: auto; border-radius: 12px; }
@media (max-width: 1023px) {
  /* The drawer sits above its scrim: before, every tap on the open menu landed on the scrim and
     closed it. */
  .side {
    z-index: 75;
    height: 100vh; height: 100dvh;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    transition: transform 220ms var(--ease-enter), visibility 0s linear 220ms;
  }
  html[data-nav-open] .side { transition: transform 220ms var(--ease-enter), visibility 0s; }
  html[data-nav-open], html[data-nav-open] body { overflow: hidden; }
  .only-drawer { display: flex; }
  .side__top .only-drawer { display: grid; }
  /* The whole drawer scrolls as one, the footer after the sections, so nothing hides. */
  .side > nav.nav { flex: none; overflow: visible; }
}
@media (max-width: 720px) {
  /* The top bar keeps the menu, the brand, the AI and the bell; the rest lives in the drawer. */
  .top { gap: 4px; padding: 0 8px 0 4px; }
  .top .search, .top .mode-pill, .top .top__theme { display: none; }
  .top__brand { margin-right: auto; }
  .seg, .tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
}

/* ---------- Charts: one drawing for a wide screen, one for a phone ---------- */
/* The phone drawing has its own proportions, so its text and lines keep their size instead of
   shrinking with the wide one. */
.chart--narrow { display: none; }
@media (max-width: 720px) {
  .chart--wide { display: none; }
  .chart--narrow { display: block; }
}

/* ---------- Tools: tabs of a tool, shortcuts on the home page ---------- */
.tool-tabs { margin: -6px 0 18px; }
.tools { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0 0 20px; }
.tool {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px;
  border-radius: var(--r-ctl); border: 1px solid var(--card-border); background: var(--card); color: var(--ink);
  transition: border-color var(--m-out) var(--ease), background var(--m-out) var(--ease);
}
.tool:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.tool__icon {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary);
}
.tool__icon .i { width: 18px; height: 18px; }
.tool__text { display: grid; gap: 2px; min-width: 0; }
.tool__name { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool__sub { font-size: 12px; color: var(--muted); line-height: 1.3; }
@media (max-width: 1480px) { .tools { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tool { padding: 10px 12px; gap: 10px; }
  .tool__icon { width: 32px; height: 32px; }
}

/* ---------- Variation grid: apply to ticked rows, make SKUs ---------- */
.grid-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); background: color-mix(in srgb, var(--hover) 60%, transparent); }
.grid-tools__row { display: flex; align-items: flex-end; gap: 10px 14px; flex-wrap: wrap; }
.grid-tools__scope { flex: 1 1 240px; align-self: center; font-size: 13px; color: var(--muted); }
.grid-tools__set { display: flex; gap: 6px; }
.grid-tools__set .input { width: 104px; }
.grid-tools__sku > summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none; padding: 4px 0; }
.grid-tools__sku > summary::-webkit-details-marker { display: none; }
.grid-tools__sku > summary .i { width: 16px; height: 16px; color: var(--primary); }
.grid-tools__sku[open] > summary { margin-bottom: 8px; }
.grid-tools__sku .field { gap: 4px; }
.grid-tools__sku .field label { font-size: 12px; }
.grid-tools__sku .check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; height: 34px; }
.grid-tools__note { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.input--sku { width: 168px; }
.input.is-invalid { border-color: var(--red); }
tr.is-picked > td { background: color-mix(in srgb, var(--primary) 7%, transparent); }
#sku-codigo { width: 120px; }
#sku-separador { width: auto; max-width: 100%; }
.grid-tools > *, .grid-tools__row > * { min-width: 0; }
.tab-short { display: none; }
@media (max-width: 720px) {
  .grid-tools { padding: 12px 16px; }
  .grid-tools__row { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .grid-tools__scope { flex: none; }
  .grid-tools__set .input { flex: 1; width: auto; min-width: 0; }
  #sku-codigo, #sku-separador { width: 100%; }
  .grid-tools__sku .check, .grid-tools__sku > summary { min-height: 40px; }
  .input--sku { width: 100%; }
  .tab-long { display: none; }
  .tab-short { display: inline; }
  .tool-tabs a { padding: 0 10px; }
}

.bulk__extra { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.bulk__extra[hidden] { display: none; }

/* ---------- Promotions: results compared ---------- */
.promo-kinds { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.promo-kinds .kpi__value small { font: 500 13px/1 var(--font-text); color: var(--muted); }
@media (max-width: 1100px) { .promo-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Product: cost of a unit ---------- */
.cost-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.cost-line__label { font-weight: 600; font-size: 13.5px; }
.cost-line__hint { font-size: 12.5px; color: var(--muted); }
.input-group--money { display: inline-flex; width: 128px; }
.input-group--money .input { width: 100%; padding-right: 36px; }
@media (max-width: 720px) { .input-group--money { width: 100%; } .input-group--money .input { padding-right: 30px; } .input-group--money .input-suffix { right: 8px; } }

/* ---------- Phones: lists ---------- */
/* The Eleve Social way: on a phone a list is not a table. Each row becomes a block with its
   first cell as the title and the others as named fields, two or three per line (the script
   names them from the header). A table of numbers to compare down a column (.table--wide) stays a table
   and scrolls sideways. */
.input--find { width: 240px; }
@media (max-width: 720px) {
  .table-wrap:not(:has(> .table--wide)) { overflow-x: visible; }
  .table:not(.table--wide), .table:not(.table--wide) > tbody { display: block; }
  .table:not(.table--wide) > thead { display: none; }
  .table:not(.table--wide) > tbody > tr {
    position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--line-soft);
  }
  .table:not(.table--wide) > tbody > tr:last-child { border-bottom: 0; }
  .table:not(.table--wide) > tbody > tr > td {
    display: block; min-width: 0; max-width: none; padding: 0; border: 0;
    text-align: left; white-space: normal; overflow-wrap: anywhere;
  }
  .table:not(.table--wide) > tbody > tr > td:empty, .table:not(.table--wide) > tbody > tr > td.is-empty { display: none; }
  .table:not(.table--wide) > tbody > tr > td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font: 500 12px/1.3 var(--font-text); color: var(--muted); letter-spacing: 0;
  }
  /* The title, a cell that spans columns, and a cell with a lot in it take the whole line. */
  .table:not(.table--wide) > tbody > tr > td:first-child:not(.check-col),
  .table:not(.table--wide) > tbody > tr > .check-col + td,
  .table:not(.table--wide) > tbody > tr > td[colspan],
  .table:not(.table--wide) > tbody > tr > td.is-wide { grid-column: 1 / -1; }
  .table:not(.table--wide) > tbody > tr > td.is-double { grid-column: span 2; }
  .table:not(.table--wide) .cell-clip, .table:not(.table--wide) .cell-wrap, .table:not(.table--wide) .returns__said { max-width: none; white-space: normal; }
  /* A long name takes two lines, not one cut short and not five. (!important: some carry an
     inline display.) */
  .table:not(.table--wide) :not(td).cell-clip { display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  /* A long state wraps inside its field instead of running over the next one. */
  .table:not(.table--wide) td .badge { max-width: 100%; height: auto; min-height: 24px; padding-block: 4px; padding-inline: 8px; gap: 5px; white-space: normal; overflow-wrap: normal; line-height: 1.25; border-radius: 12px; }
  .table:not(.table--wide) .input--num { width: 100%; text-align: left; }
  .table:not(.table--wide) .roas { max-width: 220px; }
  /* A list you can mark: the box sits beside the row, and "mark all" stays above the list. */
  .table:not(.table--wide) > tbody > tr:has(> .check-col) { padding-left: 52px; }
  .table:not(.table--wide) > tbody > tr > td.check-col { position: absolute; left: 16px; top: 14px; width: auto; }
  .table:not(.table--wide):has(> thead .check-col) > thead { display: block; }
  .table:not(.table--wide) > thead > tr { display: flex; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table:not(.table--wide) > thead th { display: none; padding: 0; border: 0; }
  .table:not(.table--wide) > thead th.check-col { display: flex; align-items: center; gap: 12px; width: auto; }
  .table:not(.table--wide) > thead th.check-col::after { content: "Marcar todos"; }
  /* Tables that stay tables: tighter cells, so more of them fits before the scroll. */
  .table--wide th, .table--wide td { padding-left: 10px; padding-right: 10px; }

  /* Search takes the line under the filters. */
  .toolbar__spacer { display: none; }
  .toolbar > form[role="search"], .card__head > form[role="search"] { flex: 1 1 100%; }
  .input--find { width: 100%; }
}

/* ---------- Phones: nothing leaves the screen, nothing is squeezed by its neighbour ---------- */
@media (max-width: 720px) {
  /* Buttons of a suggestion wrap; the main one takes its own line when three do not fit. */
  .approval__actions { flex-wrap: wrap; }
  .approval__actions .btn, .approval__actions form { flex: 1 1 auto; }
  /* The help box opens under the title, as wide as the page, wherever the "i" sits. */
  .help { position: static; }
  .page-head__title { position: relative; flex-wrap: wrap; }
  .help__box { top: calc(100% + 8px); left: 0; right: 0; width: auto; }
  /* A link or a button beside a text goes under it. */
  .notice { flex-wrap: wrap; }
  .notice__body { flex: 1 1 calc(100% - 30px); }
  .notice > a, .notice > form { margin-left: 30px; }
  .card__foot { flex-wrap: wrap; }
  .card__foot > span, .card__foot > p { flex: 1 1 200px; }
  .card__foot > .btn { flex: 1 1 auto; }
  .rows > li { flex-wrap: wrap; }
  .rows__main { flex: 1 1 150px; }
  .rows > li > .btn, .rows > li > .btn-row, .rows > li > form { margin-left: auto; }
  .auto-card__text { flex: 1 1 calc(100% - 56px); }
  .auto-card__row > .switch { margin-left: 56px; }
  .reviews-kpis--five > :last-child { grid-column: 1 / -1; }
  /* 16px in a field: below that, an iPhone zooms the page in when the field is touched. */
  .input, .select, .textarea, .cmdk__input, .textarea.paste, .input.mono, .textarea.mono { font-size: 16px; }
  .input--sm, .select--sm { height: 40px; }
}

/* ---------- Touch: small things get a finger-sized target ---------- */
@media (pointer: coarse) {
  input[type="checkbox"], input[type="radio"] { width: 24px; height: 24px; flex: none; }
  .check-col { width: 44px; }
  .seg a, .seg button, .modes span { height: 38px; }
  .help > summary { width: 36px; height: 36px; }
  .term { position: relative; flex: none; }
  .term::after { content: ""; position: absolute; inset: -12px; }
  .back, .numbers > summary, details.more > summary, .section-title a, .card__head > .link, .notice > a { padding-block: 10px; }
  .check { padding-block: 6px; align-items: center; }
  .check input { margin-top: 0; }
  .needs__item, .switch--button { min-height: 40px; }
  .back { margin-bottom: 2px; }
  .numbers > summary { margin-top: 2px; }
  .photo__move { width: 40px; height: 40px; }
}

/* ---------- A campaign's own settings, filled in by the AI ---------- */
.badge--ai { background: var(--ai-soft); color: var(--ai-ink); border: 1px solid var(--ai-line); }
.plan__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.plan__field .input-group { max-width: 240px; }
.plan__ai { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.plan__ai .plan__why { flex: 1 1 220px; }
.plan__why { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.plan__why .i { color: var(--ai-ink); flex: none; margin-top: 2px; }
.plan__why b { color: var(--ink); font-weight: 600; }
.plan__switch { display: grid; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line-soft); }
.plan__switch .switch { padding-top: 12px; }
.plan__numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0; }
.plan__numbers > div { padding: 12px 14px; border-radius: var(--r-ctl); background: var(--bg); border: 1px solid var(--line-soft); min-width: 0; }
.plan__numbers dt { font-size: 12.5px; color: var(--muted); }
.plan__numbers dd { margin: 2px 0 0; font: 700 18px/1.2 var(--font-title); letter-spacing: -0.01em; color: var(--ink); }
.plan__numbers p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.prepared { display: grid; gap: 16px; }
.approvals--stack .approval { grid-template-columns: 40px minmax(0, 1fr); }
.approvals--stack .approval__actions { grid-column: 2; flex-wrap: wrap; }
.campaign-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.prepared__card .card__title { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .campaign-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .plan__field .input-group { max-width: none; }
  .plan__numbers { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Cloning by link: the server browser's live screen ---------- */
.live__frame { position: relative; max-width: 960px; }
.live__img {
  display: block; width: 100%; height: auto; border-radius: var(--r-ctl); border: 1px solid var(--line);
  background: var(--card-solid); cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none;
}
.live__img:not([src]) { aspect-ratio: 16 / 10; }
.live__wait {
  position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 14px;
}
.live__wait[hidden] { display: none; }
.live__type { display: flex; gap: 8px; max-width: 960px; }
.live__type .input { flex: 1; min-width: 0; }
.live__keys { display: flex; gap: 8px; flex-wrap: wrap; }
