/* ==========================================================================
   Suporte (suporte.html) com o design system do app Sharingan
   Tokens e componentes copiados de public/custom-theme.css (prefixo sg-): superfícies obsidiana,
   bordas discretas e vermelho só onde significa algo. Ao mudar o tema do app, acompanhar aqui.
   ========================================================================== */

/* Inter servida pelo site (só o subconjunto latino: cobre o português) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/inter-latin.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;
}

:root {
  --sg-bg: #0b0c10;
  --sg-bg-elev: #0f1015;
  --sg-surface: #14161c;
  --sg-surface-2: #1a1d25;
  --sg-surface-3: #21252f;
  --sg-border: #22252e;
  --sg-border-strong: #2e3240;

  --sg-text: #e8eaf0;
  --sg-text-2: #a4a9b8;
  --sg-text-3: #6c7284;

  --sg-accent: #e8414b;
  --sg-accent-hover: #ff5861;
  --sg-accent-strong: #c42a34;
  --sg-accent-soft: rgba(232, 65, 75, 0.12);
  --sg-accent-line: rgba(232, 65, 75, 0.45);
  --sg-live: #3ddc84;

  --sg-radius: 10px;
  --sg-radius-sm: 7px;
  --sg-topbar-h: 56px;
  --sg-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --sg-mono: ui-monospace, 'Cascadia Code', Consolas, monospace;

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background-color: var(--sg-bg);
  color: var(--sg-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}

body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #262a34; border-radius: 8px; border: 2px solid var(--sg-bg); }
::-webkit-scrollbar-thumb:hover { background: #363b48; }

[hidden] { display: none !important; }

button { font: inherit; color: inherit; }
button:focus { outline: none; }
button:focus-visible,
a:focus-visible,
.cat:has(input:focus-visible) { outline: 2px solid var(--sg-accent); outline-offset: 2px; }

svg { flex-shrink: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sg-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

kbd {
  display: inline-block;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--sg-surface-3);
  border: 1px solid var(--sg-border-strong);
  font: 600 11px/18px var(--sg-mono);
  color: var(--sg-text);
}

/* ==========================================================================
   Barra superior
   ========================================================================== */
.sg-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--sg-topbar-h);
  flex-shrink: 0;
  background: var(--sg-bg-elev);
  border-bottom: 1px solid var(--sg-border);
  user-select: none;
}

.sg-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.sg-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.sg-brand img { width: 30px; height: 30px; border-radius: 50%; transition: transform 0.6s var(--sg-ease); }
.sg-brand:hover img { transform: rotate(120deg); }
.sg-brand__name { display: block; font-size: 15px; font-weight: 800; letter-spacing: 0.08em; color: var(--sg-text); line-height: 1.1; }
.sg-brand__tag { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; color: var(--sg-text-3); text-transform: uppercase; }

/* ==========================================================================
   Página
   ========================================================================== */
.sg-page {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 56px;
}

.sg-hero { display: flex; align-items: center; gap: 18px; padding: 4px 0 22px; }

.sg-hero__icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--sg-surface-3), var(--sg-surface));
  border: 1px solid var(--sg-border-strong);
  color: var(--sg-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sg-hero__icon svg { width: 26px; height: 26px; }
.sg-hero__text { min-width: 0; flex: 1; }
.sg-hero__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sg-accent); margin-bottom: 4px; }
.sg-hero__title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; color: var(--sg-text); }
.sg-hero__subtitle { margin-top: 4px; font-size: 13.5px; color: var(--sg-text-2); line-height: 1.5; }
.sg-hero__stats { display: flex; gap: 10px; flex-shrink: 0; }

.sg-stat { min-width: 120px; padding: 10px 14px; border-radius: var(--sg-radius); background: var(--sg-surface); border: 1px solid var(--sg-border); }
.sg-stat__value { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--sg-text); font-variant-numeric: tabular-nums; }
.sg-stat__value.is-accent { color: var(--sg-accent-hover); }
.sg-stat__label { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sg-text-3); }

.sg-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  margin: -4px 0 14px -6px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: var(--sg-radius-sm);
  background: transparent;
  color: var(--sg-text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s var(--sg-ease), color 0.15s var(--sg-ease);
}

.sg-back svg { width: 16px; height: 16px; }
.sg-back:hover { color: var(--sg-text); background: var(--sg-surface-2); }

/* Coluna principal + coluna lateral (formulário e conversa) */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }

/* ==========================================================================
   Painéis
   ========================================================================== */
.sg-panel { min-width: 0; background: var(--sg-surface); border: 1px solid var(--sg-border); border-radius: var(--sg-radius); }

.sg-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 50px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--sg-border);
}

.sg-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sg-text);
}

.sg-panel__title svg { width: 16px; height: 16px; color: var(--sg-accent); }
.sg-panel__title .sg-badge { letter-spacing: 0.02em; }

.sg-panel__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-top: 1px solid var(--sg-border);
  background: var(--sg-bg-elev);
  border-radius: 0 0 var(--sg-radius) var(--sg-radius);
}

.sg-subhead { margin: 0 0 10px; padding: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sg-text-3); }

.sg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--sg-surface-3);
  color: var(--sg-text-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-transform: none;
}

.sg-badge:empty { display: none; }
.sg-badge--accent { background: var(--sg-accent-soft); color: var(--sg-accent-hover); }
.sg-badge--closed { background: transparent; color: var(--sg-text-3); box-shadow: inset 0 0 0 1px var(--sg-border-strong); }
.sg-badge--open::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.sg-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--sg-radius-sm);
  background: var(--sg-accent-soft);
  border: 1px solid var(--sg-accent-line);
}

.sg-callout > svg { width: 18px; height: 18px; color: var(--sg-accent-hover); }
.sg-callout__text { flex: 1; min-width: 240px; font-size: 12.5px; line-height: 1.55; color: var(--sg-text-2); }
.sg-callout__text strong { color: var(--sg-text); }
.sg-callout code { display: block; margin-top: 4px; font: 12px/1.5 var(--sg-mono); color: var(--sg-accent-hover); word-break: break-all; user-select: all; }

/* ==========================================================================
   Controles
   ========================================================================== */
.sg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--sg-radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s var(--sg-ease);
}

.sg-btn svg { width: 16px; height: 16px; }
.sg-btn:active { transform: scale(0.98); }
.sg-btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.sg-btn--lg { height: 40px; padding: 0 20px; font-weight: 700; }
.sg-btn--primary { background: var(--sg-accent); color: #fff; }
.sg-btn--primary:hover { background: var(--sg-accent-hover); }
.sg-btn--ghost { background: var(--sg-surface-2); border-color: var(--sg-border); color: var(--sg-text-2); }
.sg-btn--ghost:hover { color: var(--sg-text); border-color: var(--sg-border-strong); background: var(--sg-surface-3); }
.sg-btn--danger { background: transparent; border-color: var(--sg-border); color: var(--sg-text-2); }
.sg-btn--danger:hover { color: var(--sg-accent-hover); border-color: var(--sg-accent-line); background: var(--sg-accent-soft); }
.sg-btn:disabled,
.sg-btn:disabled:hover { background: var(--sg-surface-3); border-color: transparent; color: var(--sg-text-3); cursor: progress; transform: none; }

.sg-input {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--sg-radius-sm);
  background: var(--sg-bg);
  border: 1px solid var(--sg-border-strong);
  color: var(--sg-text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s var(--sg-ease), box-shadow 0.15s var(--sg-ease);
}

textarea.sg-input { height: auto; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.sg-input::placeholder { color: var(--sg-text-3); }
.sg-input:hover { border-color: #3a3f50; }
.sg-input:focus { border-color: var(--sg-accent); box-shadow: 0 0 0 3px var(--sg-accent-soft); }
.sg-input:disabled { opacity: 0.45; cursor: not-allowed; }

.sg-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sg-field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; color: var(--sg-text-2); }
.sg-field > span small { margin-right: auto; font-size: 11px; font-weight: 500; color: var(--sg-text-3); }
.sg-field__help { font-size: 11.5px; line-height: 1.45; color: var(--sg-text-3); }
.counter { font-size: 11px; font-weight: 600; color: var(--sg-text-3); font-variant-numeric: tabular-nums; }
.counter.is-near { color: var(--sg-accent-hover); }

/* ==========================================================================
   Aviso (fica visível ao rolar: preso logo abaixo da barra superior)
   ========================================================================== */
.notice {
  position: sticky;
  top: calc(var(--sg-topbar-h) + 12px);
  z-index: 15;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 8px 10px 14px;
  border-radius: var(--sg-radius-sm);
  border: 1px solid var(--sg-border-strong);
  border-left: 3px solid var(--sg-text-3);
  background: var(--sg-surface-2);
  color: var(--sg-text);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  animation: rise 0.2s var(--sg-ease);
}

.notice.is-error { border-left-color: var(--sg-accent); }
.notice.is-ok { border-left-color: var(--sg-live); }
.notice__text { flex: 1; padding-top: 2px; }

.notice__close {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sg-text-3);
  cursor: pointer;
}

.notice__close svg { width: 16px; height: 16px; }
.notice__close:hover { color: var(--sg-text); background: var(--sg-surface-3); }

/* ==========================================================================
   Lista de pedidos
   ========================================================================== */
.tickets { display: flex; flex-direction: column; padding: 6px; }

.ticket {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--sg-radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s var(--sg-ease);
}

.ticket + .ticket { box-shadow: 0 -1px 0 var(--sg-border); }
.ticket:hover,
.ticket:hover + .ticket { box-shadow: none; }
.ticket:hover { background: var(--sg-surface-2); }

.ticket__icon {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--sg-surface-2);
  border: 1px solid var(--sg-border);
  color: var(--sg-text-3);
}

.ticket__icon svg { width: 17px; height: 17px; }
.ticket.is-answered .ticket__icon { color: var(--sg-accent); background: var(--sg-accent-soft); border-color: rgba(232, 65, 75, 0.25); }
.ticket.is-open .ticket__icon { color: var(--sg-text-2); }

.ticket__dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sg-accent);
  border: 2px solid var(--sg-surface);
}

.ticket__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ticket__subject { font-size: 14px; font-weight: 600; color: var(--sg-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket.is-closed .ticket__subject { color: var(--sg-text-2); }
.ticket.is-unread .ticket__subject { font-weight: 700; }
.ticket__meta { font-size: 12px; color: var(--sg-text-3); font-variant-numeric: tabular-nums; }
.ticket__meta code { font: 600 11.5px var(--sg-mono); color: var(--sg-text-2); }
.ticket__chevron { width: 16px; height: 16px; color: var(--sg-text-3); transition: transform 0.15s var(--sg-ease), color 0.15s var(--sg-ease); }
.ticket:hover .ticket__chevron { color: var(--sg-text); transform: translateX(2px); }

.ticket .skel--pill { width: 92px; }
.ticket__meta .skel--inline { width: 110px; }

/* Lista vinda do navegador enquanto o servidor confirma a situação */
.refreshing { display: inline-flex; align-items: center; gap: 7px; margin-right: auto; font-size: 11.5px; font-weight: 600; color: var(--sg-text-3); }
.refreshing .sg-spinner { width: 12px; height: 12px; }

/* ==========================================================================
   Novo pedido
   ========================================================================== */
.section { min-width: 0; border: 0; padding: 0 16px 18px; }
/* Legenda flutuante: assim ela não fica "na borda" do fieldset (que desce o fundo e a divisória até
   o meio dela); o respiro de cima vai nela e o resto da seção começa embaixo */
.section > legend { float: left; width: 100%; padding-top: 18px; }
.section > :not(legend) { clear: both; }
/* Divisória por sombra: numa borda de fieldset a legenda ficaria em cima da linha */
.section + .section { box-shadow: inset 0 1px 0 var(--sg-border); }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

.cat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--sg-radius-sm);
  background: var(--sg-surface-2);
  border: 1px solid var(--sg-border);
  color: var(--sg-text-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s var(--sg-ease);
}

.cat input { position: absolute; opacity: 0; pointer-events: none; }
.cat svg { width: 18px; height: 18px; color: var(--sg-text-3); transition: color 0.15s var(--sg-ease); }
.cat:hover { color: var(--sg-text); border-color: var(--sg-border-strong); background: var(--sg-surface-3); }
.cat:has(input:checked) { color: var(--sg-text); border-color: var(--sg-accent-line); background: var(--sg-accent-soft); }
.cat:has(input:checked) svg { color: var(--sg-accent); }
.cats.is-invalid .cat { border-color: var(--sg-accent-line); }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fields--stack { grid-template-columns: minmax(0, 1fr); }

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--sg-radius-sm);
  border: 1px solid rgba(61, 220, 132, 0.25);
  background: rgba(61, 220, 132, 0.06);
  color: var(--sg-text);
  font-size: 13px;
  line-height: 1.45;
}

.identity svg { width: 18px; height: 18px; color: var(--sg-live); }
.identity strong { font-weight: 600; }
/* Sem a prova do app: só orienta quem já tem licença, sem o verde de "confirmado" */
.identity--hint { border-color: var(--sg-border); background: var(--sg-surface-2); color: var(--sg-text-2); }
.identity--hint svg { color: var(--sg-text-3); }
.identity--hint strong { color: var(--sg-text); }

.trap { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile { margin-right: auto; }
.turnstile:empty { display: none; }

.aside { position: sticky; top: calc(var(--sg-topbar-h) + 16px); }

.tips { list-style: none; display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.tips li { display: flex; gap: 12px; font-size: 12.5px; line-height: 1.55; color: var(--sg-text-2); }
.tips li svg { width: 17px; height: 17px; margin-top: 1px; color: var(--sg-accent); }
.tips strong { color: var(--sg-text); font-weight: 600; }

/* ==========================================================================
   Conversa
   ========================================================================== */
.ticket-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.ticket-head__title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; word-break: break-word; }
.ticket-head__meta { margin: 6px 0 20px; font-size: 13px; color: var(--sg-text-3); }
.ticket-head__meta code { font: 600 12px var(--sg-mono); color: var(--sg-text-2); }

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--sg-text-3);
}

.live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sg-live);
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5);
  animation: pulse 2s ease-out infinite;
}

.thread { display: flex; flex-direction: column; padding: 8px 6px; }

.day {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 10px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sg-text-3);
}

.day::before,
.day::after { content: ''; flex: 1; height: 1px; background: var(--sg-border); }

.msg {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: var(--sg-radius-sm);
  transition: background-color 0.15s var(--sg-ease);
}

.msg:hover { background: var(--sg-bg-elev); }
.msg.is-new { animation: rise 0.3s var(--sg-ease); }

.msg__avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sg-surface-3);
  border: 1px solid var(--sg-border-strong);
  color: var(--sg-text-2);
  flex-shrink: 0;
}

.msg__avatar svg { width: 17px; height: 17px; }
.msg__avatar img { width: 34px; height: 34px; border-radius: 50%; }
.msg--support .msg__avatar { background: none; border: 0; box-shadow: 0 0 0 1px var(--sg-accent-line); }

.msg__body { flex: 1; min-width: 0; }
.msg__head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 3px; }
.msg__author { font-size: 13.5px; font-weight: 700; color: var(--sg-text); }
.msg--support .msg__author { color: var(--sg-accent-hover); }
.msg__time { font-size: 11.5px; color: var(--sg-text-3); font-variant-numeric: tabular-nums; }
.msg__text { font-size: 14px; line-height: 1.6; color: #d3d6df; white-space: pre-wrap; word-break: break-word; }

.composer { padding: 12px 16px 14px; border-top: 1px solid var(--sg-border); background: var(--sg-bg-elev); border-radius: 0 0 var(--sg-radius) var(--sg-radius); }
.composer__input { min-height: 84px; max-height: 320px; resize: none; }
.composer__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.composer__hint { font-size: 11.5px; color: var(--sg-text-3); }

.closed {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-top: 1px solid var(--sg-border);
  background: var(--sg-bg-elev);
  border-radius: 0 0 var(--sg-radius) var(--sg-radius);
}

.closed > svg { width: 18px; height: 18px; color: var(--sg-text-3); }
.closed p { flex: 1; min-width: 220px; font-size: 12.5px; line-height: 1.55; color: var(--sg-text-2); }

.details { display: flex; flex-direction: column; padding: 6px 16px; }
.details > div { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; }
.details > div + div { border-top: 1px solid var(--sg-border); }
.details dt { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sg-text-3); }
.details dd { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sg-text); word-break: break-word; }
.details dd code { font: 600 12.5px var(--sg-mono); }
.details dd svg { width: 15px; height: 15px; color: var(--sg-live); }
.details dd small { font-size: 12px; color: var(--sg-text-3); }

.aside__actions { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--sg-border); }
.aside__actions .sg-btn { width: 100%; }

/* ==========================================================================
   Carregamento
   ========================================================================== */

/* Anel girando no tom do texto em volta (branco no botão primário, cinza no resto) */
.sg-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

/* Botão trabalhando: o ícone vira o anel, o texto diz o que está acontecendo e a cor fica */
.sg-btn.is-loading { cursor: progress; transform: none; }
.sg-btn.is-loading > svg { display: none; }
.sg-btn.is-loading::before {
  content: '';
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.sg-btn--primary.is-loading,
.sg-btn--primary.is-loading:disabled { background: var(--sg-accent-strong); color: #fff; }
.sg-btn--ghost.is-loading:disabled { background: var(--sg-surface-2); border-color: var(--sg-border); color: var(--sg-text-2); }
.sg-btn--danger.is-loading:disabled { background: var(--sg-accent-soft); border-color: var(--sg-accent-line); color: var(--sg-accent-hover); }

/* Blocos no formato do conteúdo que ainda vai chegar */
.skel,
.skel-text,
.skel-num {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--sg-surface-2) 0%, var(--sg-surface-3) 50%, var(--sg-surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skel--line { height: 10px; }
.skel--line + .skel--line { margin-top: 9px; }
.skel--pill { width: 104px; height: 20px; border-radius: 999px; }
.skel--inline { display: inline-block; height: 9px; vertical-align: middle; }
.skel--avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.skel-text { display: inline-block; width: min(380px, 70vw); height: 26px; vertical-align: middle; }
.skel-num { width: 30px; height: 22px; margin-bottom: 4px; }
.ticket-head__meta .skel--inline { width: 230px; height: 10px; }

.msg--skel { padding: 14px 10px; }
.msg--skel:hover { background: none; }
.msg--skel .msg__body { padding-top: 4px; }

.details .skel--line { height: 9px; }
.details .skel--line:first-child { width: 64px; }

/* Na conversa carregando não há o que encerrar nem copiar ainda */
#viewTicket.is-loading .aside__actions { display: none; }

/* Resposta já na conversa enquanto o servidor confirma */
.msg--pending { opacity: 0.7; }
.msg--pending .msg__time { display: inline-flex; align-items: center; gap: 6px; }
.msg--pending .sg-spinner { width: 10px; height: 10px; border-width: 1.5px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.45); } 70%, 100% { box-shadow: 0 0 0 6px rgba(61, 220, 132, 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
  /* Anel parado parece travado: gira devagar */
  .sg-spinner,
  .sg-btn.is-loading::before { animation: spin 1.6s linear infinite !important; }
}

/* ==========================================================================
   Telas estreitas
   ========================================================================== */
@media (max-width: 880px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
}

@media (max-width: 640px) {
  .sg-topbar__inner { padding: 0 16px; }
  .sg-topbar .sg-btn span { display: none; }
  .sg-page { padding: 16px 16px 40px; }
  .sg-hero { flex-wrap: wrap; gap: 14px; }
  .sg-hero__icon { width: 46px; height: 46px; border-radius: 12px; }
  .sg-hero__icon svg { width: 22px; height: 22px; }
  .sg-hero__title { font-size: 22px; }
  .sg-hero__stats { width: 100%; }
  .sg-stat { flex: 1; min-width: 0; }
  .ticket-head__title { font-size: 20px; }
  /* Linha do pedido: situação vai para baixo do assunto, que fica com a largura toda */
  .ticket { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: start; gap: 6px 12px; }
  .ticket__icon { grid-row: 1 / span 2; }
  .ticket > .sg-badge,
  .ticket > .skel--pill { grid-column: 2; justify-self: start; }
  /* Só o anel: com o texto, o botão "Novo pedido" quebraria para outra linha */
  .refreshing__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }  .ticket__chevron { display: none; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-panel__footer .sg-btn { flex: 1; }
  .composer__hint { display: none; }
  .composer__bar { justify-content: flex-end; }
  .msg { gap: 10px; padding: 10px 6px; }
}
