/* ==========================================================================
   Componentes — visual baseado no design system Nitro™ Core (Figma).
   Os nomes das variáveis seguem os do Figma (neutral/background/bg-subtle_01
   → --neutral-bg-subtle-01). O tema segue o Illustrator: data-theme="dark|light".
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens: tema claro (Nitro "Light") ---------- */
:root {
  /* neutro */
  --neutral-bg-subtle-01: #f6f6f9;      /* fundo do painel */
  --neutral-bg-subtle-02: #ededf3;      /* superfícies: seleção, cartões */
  --neutral-bg-subtle-hover: #ebebef;
  --neutral-bg-tint-01: #9e9fa9;
  --neutral-fg-high: #202224;           /* texto principal */
  --neutral-fg-low: #5c5f66;            /* texto secundário, rótulos */
  --neutral-border: #dddde3;            /* bordas */
  --neutral-border-hover: #d3d4db;
  --neutral-border-pressed: #b9bbc6;
  --neutral-bg-disabled: #ebebef52;
  --neutral-fg-disabled: #484b5052;
  --field-bg: #fcfcfc;                  /* pure-neutral/white: campos */
  --inverse-bg: #0d0d0d;                /* pure-neutral/black: notificação */
  --inverse-fg: #fcfcfc;
  --static-white: #fcfcfc;

  /* destaque (roxo) */
  --accent-tint-01: #883cec;            /* botão principal, aba ativa, links */
  --accent-tint-02: #6e18de;            /* hover do principal */
  --accent-bg-subtle-01: #f9f5ff;
  --accent-bg-subtle-enabled: #e7d7fd;
  --accent-fg-low: #6918d1;
  --accent-fg-high: #360f5e;
  --accent-border: #c6a0f9;
  --accent-bg-disabled: #e0cbfc52;
  --accent-fg-disabled: #6918d152;      /* também é o anel de foco */

  /* erro */
  --error-tint-01: #dd4249;
  --error-bg-subtle-01: #fef3f4;
  --error-bg-subtle-enabled: #fce2e4;
  --error-fg-low: #ca292e;
  --error-border: #f5aeb3;
  --error-border-pressed: #ec7e85;

  /* aviso */
  --warning-bg-subtle-01: #fffefa;
  --warning-fg-high: #a5840a;
  --warning-border: #ffefbc;

  /* sucesso */
  --success-bg-subtle-01: #f3fcf6;
  --success-fg-low: #218358;
  --success-border: #adddc0;

  --overlay-1: #0d0d0d0a;               /* sombra xs */
  --overlay-2: #0d0d0d2e;               /* sombra da notificação */

  /* cores de texto/estado com contraste AA (derivadas do Nitro, mesmo tom) */
  --accent-text: #883cec;               /* links, aba ativa: 4,6:1 nos cards */
  --accent-hover: #6e18de;              /* hover do botão principal */
  --warn-text: #7a5d00;                 /* "desatualizadas", "não salvo": 5,3:1 */
  --danger-text: #b4232a;               /* link de excluir, erro no campo */
  --danger-solid: #c4282f;              /* botão de confirmar exclusão, aviso de erro */
  --focus-ring: #883cec;

  /* tipografia (Nitro _Typography) */
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --fs-xs: 10px;
  --fs-sm: 12px;
  --fs-md: 14px;
  --fs-lg: 16px;

  /* espaçamentos e raios (Nitro 2. Radius / 3. Padding) */
  --pad-xs: 4px;
  --pad-sm: 8px;
  --pad-md: 12px;
  --pad-lg: 16px;
  --pad-xl: 20px;
  --pad-xxl: 32px;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px 0 var(--overlay-1);

  color-scheme: light;
}

/* ---------- Tokens: tema escuro (Nitro "Dark") ---------- */
:root[data-theme="dark"] {
  --neutral-bg-subtle-01: #1d1d20;
  --neutral-bg-subtle-02: #29292e;
  --neutral-bg-subtle-hover: #2e3035;
  --neutral-bg-tint-01: #696e77;
  --neutral-fg-high: #edeef0;
  --neutral-fg-low: #adb1b8;
  --neutral-border: #3c3f44;
  --neutral-border-hover: #464b50;
  --neutral-border-pressed: #5a6165;
  --neutral-bg-disabled: #2e303552;
  --neutral-fg-disabled: #adb1b852;
  --field-bg: #151515;
  --inverse-bg: #fcfcfc;
  --inverse-fg: #151515;

  --accent-tint-01: #883cec;
  --accent-tint-02: #b57eec;
  --accent-bg-subtle-01: #13081c;
  --accent-bg-subtle-enabled: #421a67;
  --accent-fg-low: #c293f1;
  --accent-fg-high: #faf6fe;
  --accent-border: #5e239b;
  --accent-bg-disabled: #4b1d7652;
  --accent-fg-disabled: #c293f152;

  --error-tint-01: #e26067;
  --error-bg-subtle-01: #1c0908;
  --error-bg-subtle-enabled: #611b1a;
  --error-fg-low: #ed9095;
  --error-border: #932426;
  --error-border-pressed: #d94047;

  --warning-bg-subtle-01: #1c1907;
  --warning-fg-high: #ffe7b3;
  --warning-border: #9b8723;

  --success-bg-subtle-01: #0e1512;
  --success-fg-low: #3dd68c;
  --success-border: #20573e;

  --overlay-1: #fcfcfc0a;

  --accent-text: #c293f1;               /* accent/fg-low: 6:1 nos cards (o #883cec dava 2,7:1) */
  --accent-hover: #7433e0;              /* o tint_02 escuro (#b57eec) deixava o texto branco ilegível */
  --warn-text: #ffe7b3;
  --danger-text: #ed9095;
  --danger-solid: #c4282f;
  --focus-ring: #c293f1;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--neutral-bg-subtle-01);
  color: var(--neutral-fg-high);
  font: 400 var(--fs-sm)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
b, strong { font-weight: 600; }

.muted { color: var(--neutral-fg-low); }
.warn { color: var(--warn-text); }
.accent-text { color: var(--accent-text); font-weight: 600; }

/* ---------- Ícones (máscara: assumem a cor do texto) ---------- */
.ico { display: inline-block; width: 16px; height: 16px; flex: none; background: currentColor; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.ico-email   { -webkit-mask-image: url('../img/icone-email.svg');     mask-image: url('../img/icone-email.svg'); }
.ico-lock    { -webkit-mask-image: url('../img/icone-cadeado.svg');   mask-image: url('../img/icone-cadeado.svg'); }
.ico-eye     { -webkit-mask-image: url('../img/icone-olho.svg');      mask-image: url('../img/icone-olho.svg'); }
.ico-refresh { -webkit-mask-image: url('../img/icone-atualizar.svg'); mask-image: url('../img/icone-atualizar.svg'); }
.ico-user    { -webkit-mask-image: url('../img/icone-usuario.svg');   mask-image: url('../img/icone-usuario.svg'); }
.ico-close   { -webkit-mask-image: url('../img/icone-fechar.svg');    mask-image: url('../img/icone-fechar.svg'); }

/* ---------- Botões (Nitro Button) ----------
   .btn          = Secondary (padrão)   .btn.primary = Primary
   .btn.ghost    = Tertiary             .btn.danger  = Danger
   tamanhos: padrão = Extra Small (28)  .lg = Small (40, login)          */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--pad-xs);
  min-height: 28px; padding: 4px 10px;
  border: 1px solid var(--neutral-border); border-radius: var(--radius-xs);
  background: var(--neutral-bg-subtle-01); color: var(--neutral-fg-high);
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.5;
  box-shadow: var(--shadow-xs);
  cursor: pointer; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--neutral-bg-subtle-02); }
/* foco: mesmo anel em todos os controles (2px, contraste >= 3:1) */
.btn:focus-visible, .icon-btn:focus-visible, .link:focus-visible, .seg button:focus-visible,
.slot-label:focus-visible, .card-toggle:focus-visible, .input-action:focus-visible, input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 2px;
}
.btn:disabled { background: var(--neutral-bg-disabled); color: var(--neutral-fg-disabled); cursor: default; box-shadow: none; }

.btn.primary { background: var(--accent-tint-01); border-color: var(--accent-tint-01); color: var(--static-white); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary:disabled { background: var(--accent-bg-disabled); border-color: transparent; color: var(--accent-fg-disabled); }

.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--neutral-bg-subtle-02); }

.btn.danger { background: var(--danger-solid); border-color: var(--danger-solid); color: var(--static-white); }
.btn.danger:hover { filter: brightness(1.06); }

.btn.lg { min-height: 37px; padding: var(--pad-sm); font-size: var(--fs-md); }
.btn.block { width: 100%; }

/* Link (Nitro Link Button / Interactive) */
.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent-text); font-size: var(--fs-sm); font-weight: 500;
}
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
.link.danger { color: var(--danger-text); }
.link:focus-visible { border-radius: 2px; }

/* Icon Button (Nitro, XSmall 24) */
.icon-btn {
  display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 4px; flex: none;
  border: 1px solid var(--neutral-border); border-radius: var(--radius-xs);
  background: var(--neutral-bg-subtle-01); color: var(--neutral-fg-high);
  box-shadow: var(--shadow-xs); cursor: pointer;
}
.icon-btn:hover { background: var(--neutral-bg-subtle-02); }
.icon-btn[aria-expanded="true"] { background: var(--neutral-bg-subtle-02); border-color: var(--neutral-border-pressed); }

/* ---------- Campos (Nitro Text Input) ---------- */
.input {
  display: flex; align-items: center; gap: var(--pad-sm); width: 100%;
  padding: var(--pad-sm); border: 1.5px solid var(--neutral-border); border-radius: var(--radius-xs);
  background: var(--field-bg); color: var(--neutral-fg-low); box-shadow: var(--shadow-xs);
  cursor: text; transition: border-color .12s, box-shadow .12s;
}
.input input {
  flex: 1; min-width: 0; border: 0; padding: 0; outline: none; background: transparent;
  color: var(--neutral-fg-high); font-size: var(--fs-sm); font-weight: 500;
}
.input input::placeholder { color: var(--neutral-fg-low); }
.input:hover { border-color: var(--neutral-border-hover); }
.input:focus-within { border-color: var(--accent-tint-01); box-shadow: 0 0 0 4px var(--accent-fg-disabled), var(--shadow-xs); }
.input.err { background: var(--error-bg-subtle-enabled); border-color: var(--error-border-pressed); color: var(--danger-text); }
.input.err input { color: var(--danger-text); }
.input-action { display: grid; place-items: center; padding: 4px; margin: -4px; border: 0; border-radius: 4px; background: none; color: var(--neutral-fg-low); cursor: pointer; }
.input-action.on { color: var(--accent-text); }

input[type="text"], select, textarea {
  width: auto; min-width: 0;
  padding: 6px var(--pad-sm); border: 1.5px solid var(--neutral-border); border-radius: var(--radius-xs);
  background: var(--field-bg); color: var(--neutral-fg-high); box-shadow: var(--shadow-xs);
  font-size: var(--fs-sm); font-weight: 500; line-height: 1.5;
}
input[type="text"]::placeholder, textarea::placeholder { color: var(--neutral-fg-low); }
input[type="text"]:hover, select:hover, textarea:hover { border-color: var(--neutral-border-hover); }
input[type="text"]:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-tint-01); box-shadow: 0 0 0 4px var(--accent-fg-disabled); }
textarea { width: 100%; min-height: 110px; resize: vertical; line-height: 1.5; font-weight: 400; }
textarea.small { min-height: 52px; }
input[type="checkbox"] { accent-color: var(--accent-tint-01); width: 14px; height: 14px; margin: 0; }

/* ---------- Badge (Nitro Badges) ---------- */
.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 2px 6px;
  border: 1px solid var(--accent-border); border-radius: var(--radius-xs);
  background: var(--accent-bg-subtle-01); color: var(--accent-fg-low);
  font-size: var(--fs-xs); font-weight: 500; letter-spacing: 1px; text-transform: uppercase;
}

/* ---------- Alertas (Nitro Alerts) ---------- */
.alert {
  display: flex; align-items: center; gap: var(--pad-md);
  padding: var(--pad-sm) var(--pad-md); border: 1px solid var(--neutral-border); border-radius: var(--radius-sm);
  background: var(--neutral-bg-subtle-02); box-shadow: var(--shadow-xs);
  color: var(--neutral-fg-high); font-size: var(--fs-sm); font-weight: 500;
}
.alert-ico { width: 24px; height: 24px; flex: none; }
.alert-ico:not([src]) { display: none; }
.alert-text { flex: 1; min-width: 0; }
.alert.err { background: var(--error-bg-subtle-01); border-color: var(--error-border); }
.alert.info { background: var(--accent-bg-subtle-01); border-color: var(--accent-border); }
.alert.ok { background: var(--success-bg-subtle-01); border-color: var(--success-border); }

/* aviso dentro dos cards (mestre ambíguo, sem mestre) */
.notice {
  padding: var(--pad-sm) var(--pad-md); border: 1px solid var(--accent-border); border-radius: var(--radius-sm);
  background: var(--accent-bg-subtle-01); color: var(--neutral-fg-high); font-size: var(--fs-sm);
}

/* ---------- Login ---------- */
.auth { flex: 1; display: flex; justify-content: center; }
.auth-card {
  width: 100%; max-width: 320px; padding: var(--pad-xxl) var(--pad-xl);
  display: flex; flex-direction: column; align-items: center; gap: var(--pad-xxl); text-align: center;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: var(--pad-xl); }
.logo {
  display: grid; place-items: center; width: 40px; height: 40px; padding: var(--pad-sm);
  border-radius: var(--radius-xs); background: var(--accent-tint-01); box-shadow: var(--shadow-xs);
}
.auth-title { display: flex; flex-direction: column; align-items: center; gap: var(--pad-xs); }
.auth-title h1 { margin: 0; font-size: var(--fs-lg); font-weight: 700; line-height: 1.5; color: var(--neutral-fg-high); }
.auth-lead, .auth-foot { margin: 0; color: var(--neutral-fg-low); font-size: var(--fs-sm); }
#login-form, #pwd-form { width: 100%; display: flex; flex-direction: column; gap: var(--pad-lg); }
.fields { display: flex; flex-direction: column; gap: var(--pad-lg); }
#auth-msg { width: 100%; text-align: left; }

/* senha: regras que acendem conforme a pessoa digita */
#pwd-form .btn.ghost { margin-top: calc(-1 * var(--pad-sm)); }
.pw-rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; text-align: left; color: var(--neutral-fg-low); font-size: var(--fs-sm); }
.pw-rules li { display: flex; align-items: center; gap: var(--pad-sm); }
.pw-rules li::before {
  content: ''; flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--neutral-border-pressed); box-sizing: border-box;
}
.pw-rules li.ok { color: var(--neutral-fg-high); }
.pw-rules li.ok::before {
  border-color: var(--success-fg-low); background: var(--success-fg-low);
  -webkit-mask: none;
  box-shadow: inset 0 0 0 3px var(--neutral-bg-subtle-01);
}
.account-links { display: inline-flex; gap: var(--pad-lg); }

/* ---------- App ---------- */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.app > .top, .app > .tabs { flex: none; }
.app > .selection { flex: none; max-height: 45vh; overflow-y: auto; }
.app > .list { min-height: 0; overflow-y: auto; }

.top { display: flex; flex-direction: column; gap: var(--pad-sm); padding: var(--pad-lg); }
.top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--pad-xxl); }
.top-title { display: flex; flex-direction: column; min-width: 0; }
.top-title h1 { margin: 0; font-size: var(--fs-md); font-weight: 500; line-height: 1.5; color: var(--neutral-fg-high); }
.top-title span { font-size: var(--fs-xs); color: var(--neutral-fg-low); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; gap: var(--pad-sm); }

/* cartão da conta */
.account {
  display: flex; flex-direction: column; gap: var(--pad-sm); padding: var(--pad-lg);
  border: 1px solid var(--neutral-border); border-radius: var(--radius-xs);
  background: var(--neutral-bg-subtle-02); box-shadow: var(--shadow-xs);
}
.account-info { display: flex; flex-direction: column; min-width: 0; }
.account-email { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-plan { color: var(--neutral-fg-low); }
.account-lang { display: flex; align-items: center; justify-content: space-between; gap: var(--pad-sm); }
.account-lang .seg { flex: 1; max-width: 200px; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: var(--pad-xs); }
.account-row .link { font-size: var(--fs-md); }
/* com a conta aberta, o vencimento já aparece nela */
#account:not([hidden]) ~ #license-warn { display: none !important; }

/* abas (Nitro Tab) */
.tabs { display: flex; background: var(--neutral-bg-subtle-01); }
.tab {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: var(--pad-sm) var(--pad-sm) var(--pad-md);
  border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer;
  color: var(--neutral-fg-low); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
}
.tab:hover { color: var(--neutral-fg-high); }
.tab.on { color: var(--accent-text); border-bottom-color: var(--accent-tint-01); font-weight: 600; }
.tab .count {
  min-width: 16px; padding: 0 5px; border-radius: 99px; line-height: 16px;
  background: var(--neutral-bg-subtle-02); color: var(--neutral-fg-low); font-size: var(--fs-xs); font-weight: 600;
}
.tab.on .count { background: var(--accent-bg-subtle-enabled); color: var(--accent-fg-low); }
.tab:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; border-radius: 4px; }

/* seção de seleção (largura total) */
.selection {
  display: flex; flex-direction: column; gap: var(--pad-sm); padding: var(--pad-lg);
  background: var(--neutral-bg-subtle-02); border-bottom: 1px solid var(--neutral-border);
}
.sel-label { color: var(--neutral-fg-low); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }
.sel-summary { color: var(--neutral-fg-high); }
.selection .muted { color: var(--neutral-fg-high); }
.check { display: inline-flex; align-items: center; gap: var(--pad-sm); cursor: pointer; }
.check.two { align-items: flex-start; }
.check.two input { margin-top: 3px; }
.check small { display: block; color: var(--neutral-fg-low); font-size: var(--fs-sm); }
.selection .check small { color: var(--neutral-fg-low); }

.row { display: flex; gap: var(--pad-sm); align-items: center; flex-wrap: wrap; }
.row > .grow, .grow { flex: 1; min-width: 0; }
.row-links { gap: var(--pad-lg); padding-top: var(--pad-xs); }

/* lista */
.list { display: flex; flex-direction: column; gap: var(--pad-sm); padding: var(--pad-lg); flex: 1; }

/* estado vazio */
.empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--pad-lg);
  padding: var(--pad-lg) 0; text-align: center; color: var(--neutral-fg-low);
}
.empty img { width: 94px; height: 94px; object-fit: cover; }
.empty-text { display: flex; flex-direction: column; gap: var(--pad-sm); }
.empty-text p { margin: 0; }
.empty-text b { color: var(--neutral-fg-high); }

/* cards de componente */
.card {
  border: 1px solid var(--neutral-border); border-radius: var(--radius-xs);
  background: var(--neutral-bg-subtle-02); box-shadow: var(--shadow-xs);
  transition: border-color .12s;
}
.card:hover { border-color: var(--neutral-border-hover); }
.card.open { border-color: var(--neutral-border-pressed); }
.card-head { display: flex; align-items: center; gap: var(--pad-sm); padding: var(--pad-md) var(--pad-md) 0; cursor: pointer; user-select: none; }
.card-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--pad-sm);
  margin: -2px; padding: 2px; border: 0; border-radius: 4px; background: none; cursor: pointer; text-align: left;
}
.card-head .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); font-weight: 600; }
.card-head input { flex: 1; }
.chev { display: grid; place-items: center; color: var(--neutral-fg-low); transition: transform .12s; }
/* tipo do componente (aba Componentes): Texto / Grupo */
.type-tag {
  flex: none; padding: 0 6px; line-height: 18px;
  border: 1px solid var(--neutral-border); border-radius: 4px; background: var(--neutral-bg-subtle-01);
  color: var(--neutral-fg-low); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .5px; text-transform: uppercase;
}
.card.open > .card-head .chev { transform: rotate(90deg); }
.meta { padding: 2px var(--pad-md) var(--pad-md) 30px; color: var(--neutral-fg-low); cursor: pointer; }
.meta .warn { color: var(--warn-text); font-weight: 500; }

.body { display: flex; flex-direction: column; gap: var(--pad-sm); padding: var(--pad-md); border-top: 1px solid var(--neutral-border); }
.field-label { display: flex; justify-content: space-between; color: var(--neutral-fg-low); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }
.dirty { color: var(--warn-text); letter-spacing: 0; text-transform: none; font-size: var(--fs-sm); }
.hint { margin: 0; color: var(--neutral-fg-low); font-size: var(--fs-sm); }
/* textos do mestre (grupo): lista que abre e fecha */
.texts { padding-bottom: var(--pad-xs); }
.texts summary { list-style: none; cursor: pointer; align-items: center; border-radius: 2px; }
.texts summary::-webkit-details-marker { display: none; }
.texts summary:hover { color: var(--neutral-fg-high); }
.texts summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.texts-title { display: inline-flex; align-items: center; gap: 6px; }
.texts[open] .chev { transform: rotate(90deg); }
.texts-body { display: flex; flex-direction: column; gap: var(--pad-sm); padding-top: var(--pad-sm); }
/* "Saiba mais" das dicas */
.more { margin-top: -4px; color: var(--neutral-fg-low); font-size: var(--fs-sm); }
.more summary { width: max-content; color: var(--accent-text); font-weight: 500; cursor: pointer; list-style: none; border-radius: 2px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ' ›'; }
.more[open] summary::after { content: ' ‹'; }
.more summary:hover { text-decoration: underline; text-underline-offset: 2px; }
.more summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.more p { margin: var(--pad-xs) 0 0; }
.divider { height: 1px; background: var(--neutral-border); margin: var(--pad-xs) 0; }

/* rótulos editáveis dos textos do grupo */
.slot-label {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 5px;
  margin-bottom: -4px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--neutral-fg-high); font-size: var(--fs-sm); font-weight: 500;
}
.slot-label .pencil { color: var(--neutral-fg-low); opacity: 0; transition: opacity .12s; }
.slot-label:hover .pencil, .slot-label:focus-visible .pencil { opacity: 1; }
.slot-input { font-size: var(--fs-sm); padding: 2px 6px; margin-bottom: -4px; }

/* seletor segmentado */
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px;
  border: 1px solid var(--neutral-border); border-radius: var(--radius-xs); background: var(--neutral-bg-subtle-01);
}
.seg button {
  padding: 4px; border: 0; border-radius: 4px; background: transparent; cursor: pointer;
  color: var(--neutral-fg-low); font-size: var(--fs-sm); font-weight: 500;
}
.seg button:hover { color: var(--neutral-fg-high); }
.seg button.on { background: var(--accent-bg-subtle-enabled); color: var(--accent-fg-high); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent-border); }
.seg4 { grid-template-columns: repeat(4, 1fr); }

/* imagens */
.file-row {
  display: flex; flex-direction: column; gap: 1px; padding: var(--pad-sm);
  border: 1.5px solid var(--neutral-border); border-radius: var(--radius-xs); background: var(--field-bg);
}
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* exportar */
.export { display: flex; flex-direction: column; gap: var(--pad-sm); }
.export .warn { color: var(--error-fg-low); }
.fmt {
  display: flex; flex-direction: column; gap: var(--pad-sm); padding: var(--pad-sm) var(--pad-md);
  border: 1px solid var(--neutral-border); border-radius: var(--radius-xs); background: var(--neutral-bg-subtle-02);
}
.fmt-opts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pad-sm); padding-left: 22px; }
.folder-row { display: flex; align-items: center; gap: var(--pad-sm); }
.folder-path {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 5px var(--pad-sm); border: 1.5px solid var(--neutral-border); border-radius: var(--radius-xs);
  background: var(--field-bg); font-weight: 500;
}
.export > input[type="text"] { width: 100%; }
.export-foot {
  position: sticky; bottom: calc(-1 * var(--pad-lg)); z-index: 1;
  display: flex; flex-direction: column; gap: var(--pad-sm);
  margin: 0 calc(-1 * var(--pad-lg)) calc(-1 * var(--pad-lg)); padding: var(--pad-md) var(--pad-lg) var(--pad-lg);
  background: var(--neutral-bg-subtle-01); border-top: 1px solid var(--neutral-border);
}

/* ---------- Notificação (toast) ---------- */
.toast {
  position: fixed; left: var(--pad-lg); right: var(--pad-lg); bottom: var(--pad-lg); z-index: 10;
  padding: var(--pad-sm) var(--pad-md); border-radius: var(--radius-sm);
  background: var(--inverse-bg); color: var(--inverse-fg); box-shadow: 0 4px 12px var(--overlay-2);
  font-size: var(--fs-sm); font-weight: 500;
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--danger-solid); color: var(--static-white); }

/* ação em andamento */
body.busy, body.busy * { cursor: progress !important; }
.btn[aria-busy="true"] { opacity: .75; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
