/* ==========================================================================
   NSPreview · app.css
   Tokens NSLog, componentes, login, editor e mockups do Instagram.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --navy: #001B44;
  --navy-2: #0A2A5C;
  --navy-3: #12376F;
  --blue: #008CCB;
  --orange: #F25C05;
  --white: #FFFFFF;

  --bg: #F5F8FC;
  --surface: #FFFFFF;
  --surface-2: #F9FBFE;
  --surface-3: #EEF3F9;
  --border: #E6EDF5;
  --border-strong: #D3DEEA;
  --text: #13233F;
  --title: #001B44;
  --muted: #5B6B82;
  --placeholder: #8392A8;

  /* Variações com contraste AA para texto e fundos de botão */
  --primary: #0079B0;
  --primary-hover: #00699A;
  --link: #0079B0;
  --blue-soft: #E4F3FA;
  --orange-hover: #DE5200;
  --orange-ink: #B34100;
  --orange-soft: #FEEEE4;
  --green: #1FA971;
  --green-ink: #12784F;
  --green-soft: #E3F6EE;
  --red: #E5484D;
  --red-ink: #C42B30;
  --red-soft: #FDECEC;
  --danger-bg: #C42B30;

  --ring-color: #008CCB;
  --shadow-xs: 0 1px 2px rgba(0, 27, 68, .06);
  --shadow-sm: 0 1px 2px rgba(0, 27, 68, .05), 0 4px 12px rgba(0, 27, 68, .05);
  --shadow: 0 2px 6px rgba(0, 27, 68, .04), 0 12px 32px rgba(0, 27, 68, .07);
  --shadow-lg: 0 8px 24px rgba(0, 27, 68, .10), 0 32px 64px rgba(0, 27, 68, .16);

  --radius-sm: 8px;
  --radius: 10px;
  --radius-card: 16px;
  --radius-lg: 20px;

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 200ms;

  --sidebar-w: 88px;
  --preview-w: 460px;
  --topbar-h: 68px;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #001B44;
  --surface: #0A2A5C;
  --surface-2: #0C3066;
  --surface-3: #123B78;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .18);
  --text: #E6EDF7;
  --title: #FFFFFF;
  --muted: #A3B4CC;
  --placeholder: #7D93B4;
  --link: #5CC4F0;
  --blue-soft: rgba(0, 140, 203, .2);
  --orange-ink: #FFA06A;
  --orange-soft: rgba(242, 92, 5, .18);
  --green-ink: #5ED8A4;
  --green-soft: rgba(31, 169, 113, .18);
  --red-ink: #FF8E92;
  --red-soft: rgba(229, 72, 77, .18);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .22);
  --shadow: 0 4px 12px rgba(0, 0, 0, .18), 0 16px 40px rgba(0, 0, 0, .22);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .35), 0 32px 64px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--title); font-weight: 700; letter-spacing: -.015em; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--link); }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--ring-color); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 500;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: none; }

.icon { display: block; flex-shrink: 0; }
.icon-slot { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font: 600 11px var(--font);
  color: var(--muted);
  box-shadow: 0 1px 0 var(--border-strong);
}

/* ---------- 3. Marca ---------- */
.brand-logo { display: block; height: 32px; width: auto; }
.brand--lg.brand-logo { height: 40px; }
.brand-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.03em;
  color: var(--title);
  line-height: 1;
}
.brand--lg.brand-text { font-size: 26px; gap: 12px; }
.brand-word b { color: var(--blue); font-weight: 800; }
.brand-mark { display: inline-grid; grid-template-columns: repeat(2, 9px); gap: 3px; }
.brand-mark i { display: block; width: 9px; height: 9px; border-radius: 2px; background: var(--navy); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: var(--blue); }
.brand-mark i:nth-child(4) { background: var(--orange); }
.brand--lg .brand-mark { grid-template-columns: repeat(2, 11px); }
.brand--lg .brand-mark i { width: 11px; height: 11px; }
.brand-mark--light i:nth-child(1), [data-theme="dark"] .brand-mark i:nth-child(1) { background: #fff; }

/* ---------- 4. Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  font: 600 14px/1 var(--font);
  color: var(--title);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn--sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn--lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn--block { width: 100%; }

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }

.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-3); }
[data-theme="dark"] .btn--navy { background: #fff; color: var(--navy); }

.btn--cta {
  height: 56px;
  padding: 0 26px;
  border-radius: 12px;
  background: var(--orange);
  color: #fff;
  font-size: 19px; /* texto grande e em negrito: contraste AA sobre o laranja */
  font-weight: 700;
  letter-spacing: -.01em;
  box-shadow: 0 8px 20px rgba(242, 92, 5, .28);
}
.btn--cta:hover { background: var(--orange-hover); box-shadow: 0 12px 28px rgba(242, 92, 5, .34); }
.btn--cta:disabled { box-shadow: none; }

.btn--outline { border-color: var(--border-strong); background: var(--surface); color: var(--title); }
.btn--outline:hover { border-color: var(--blue); color: var(--link); }

.btn--ghost { color: var(--muted); }
.btn--ghost:hover { background: var(--surface-3); color: var(--title); box-shadow: none; }

.btn--soft { background: var(--blue-soft); color: var(--link); }
.btn--soft:hover { background: var(--primary); color: #fff; }

.btn--danger { background: var(--danger-bg); color: #fff; }
.btn--danger:hover { background: #A92328; }

.btn--whatsapp { background: #12784F; color: #fff; }
.btn--whatsapp:hover { background: #0E643F; }

.btn.is-loading { pointer-events: none; }
.btn.is-loading .icon-slot { display: none; }
.btn.is-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin .7s linear infinite;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--title); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; background: transparent; }
.icon-btn--bordered { border-color: var(--border); background: var(--surface); }
.icon-btn--bordered:hover { border-color: var(--blue); color: var(--link); background: var(--surface); }
.icon-btn--danger:hover { color: var(--red-ink); background: var(--red-soft); }
.icon-btn[aria-pressed="true"] { color: var(--link); border-color: var(--blue); background: var(--blue-soft); }

.text-link { color: var(--link); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 5. Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 600; color: var(--title); }
.label--sm { font-size: 12px; color: var(--muted); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.field-error { font-size: 13px; font-weight: 600; color: var(--red-ink); }
.field-foot { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.field-foot .hint { margin-left: auto; white-space: nowrap; }

.input, .textarea, .select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: 500 14px/1.4 var(--font);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--placeholder); font-weight: 400; }
.input:hover, .textarea:hover, .select:hover { border-color: #B9C8DA; }
[data-theme="dark"] .input:hover, [data-theme="dark"] .textarea:hover, [data-theme="dark"] .select:hover { border-color: rgba(255, 255, 255, .28); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 140, 203, .22);
}
.input--lg { height: 48px; font-size: 15px; }
.textarea { height: auto; min-height: 160px; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.textarea--sm { min-height: 84px; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(229, 72, 77, .18); }

.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='%235B6B82' 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;
}
.select--sm { height: 38px; font-size: 13.5px; }

.input-group { position: relative; display: flex; align-items: center; }
.input-prefix { position: absolute; left: 12px; color: var(--muted); font-weight: 600; pointer-events: none; }
.input--prefixed { padding-left: 28px; }
.input-action {
  position: absolute;
  right: 5px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.input-action:hover { color: var(--title); background: var(--surface-3); }

.range { width: 100%; accent-color: var(--blue); cursor: pointer; height: 24px; }

/* ---------- 6. Segmented control, chips e badges ---------- */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-3);
}
.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: 600 13px var(--font);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.segmented button:hover { color: var(--title); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--title); box-shadow: var(--shadow-xs); }
[data-theme="dark"] .segmented { background: rgba(0, 0, 0, .22); }
[data-theme="dark"] .segmented button[aria-pressed="true"] { background: var(--surface-3); }
.segmented--block { display: flex; }
.segmented--block button { flex: 1; }

.ratio-ico { display: inline-block; border: 1.75px solid currentColor; border-radius: 3px; }
.ratio-ico--11 { width: 14px; height: 14px; }
.ratio-ico--45 { width: 12px; height: 15px; }
.ratio-ico--34 { width: 12px; height: 16px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: 600 13px var(--font);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--title); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
[data-theme="dark"] .chip.is-active { background: #fff; border-color: #fff; color: var(--navy); }
.chip-count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--title);
  font-size: 11.5px;
  font-weight: 700;
}
.chip.is-active .chip-count { background: rgba(255, 255, 255, .18); color: inherit; }
[data-theme="dark"] .chip.is-active .chip-count { background: var(--surface-3); color: #fff; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font: 700 12px/1 var(--font);
  white-space: nowrap;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.badge--pending { background: var(--orange-soft); color: var(--orange-ink); }
.badge--pending .badge-dot { background: var(--orange); }
.badge--approved { background: var(--green-soft); color: var(--green-ink); }
.badge--approved .badge-dot { background: var(--green); }
.badge--changes { background: var(--red-soft); color: var(--red-ink); }
.badge--changes .badge-dot { background: var(--red); }

.count-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--title);
  font: 700 12.5px var(--font);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 7. Cards, banners e alertas ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 24px;
  min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.card-heading { display: flex; align-items: flex-start; gap: 14px; }
.card-title { font-size: 16px; font-weight: 700; }
.card-sub { margin-top: 4px; font-size: 13px; color: var(--muted); max-width: 560px; }
.step {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--link);
  font: 800 12.5px var(--font);
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--blue);
}
.banner--draft { border-left-color: var(--orange); }
.banner-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--blue-soft); color: var(--link); }
.banner--draft .banner-icon { background: var(--orange-soft); color: var(--orange-ink); }
.banner-body { flex: 1; min-width: 0; }
.banner-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-weight: 700; color: var(--title); font-size: 14.5px; }
.banner-text { margin-top: 2px; font-size: 13px; color: var(--muted); }
.banner-quote {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13.5px;
}
.banner-quote-meta { font-size: 12px; font-weight: 700; color: var(--muted); }
.banner-quote-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.banner-actions { display: flex; gap: 6px; flex-shrink: 0; }

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  margin-bottom: 18px;
  line-height: 1.45;
}
.alert .icon-slot { margin-top: 1px; }
.alert--error { background: var(--red-soft); color: var(--red-ink); }
.alert--warn { background: var(--orange-soft); color: var(--orange-ink); }

/* ---------- 8. Toasts ---------- */
.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 400px;
  padding: 12px 10px 12px 14px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px) scale(.98);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
[data-theme="dark"] .toast { background: #00112B; border: 1px solid rgba(255, 255, 255, .1); }
.toast.is-visible { opacity: 1; transform: none; }
.toast-icon { display: grid; place-items: center; flex-shrink: 0; }
.toast--success .toast-icon { color: #5ED8A4; }
.toast--error .toast-icon { color: #FF8E92; }
.toast--info .toast-icon { color: #6CCDF4; }
.toast-text { flex: 1; }
.toast-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, .6);
  cursor: pointer;
}
.toast-close:hover { color: #fff; background: rgba(255, 255, 255, .1); }

/* ---------- 9. Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 14, 36, .56);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.modal-backdrop.is-open { opacity: 1; }
.modal {
  position: relative;
  width: min(500px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.98);
  transition: transform 240ms var(--ease);
}
.modal-backdrop.is-open .modal { transform: none; }
.modal-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 14px;
}
.modal-icon--blue { background: var(--blue-soft); color: var(--link); }
.modal-icon--green { background: var(--green-soft); color: var(--green-ink); }
.modal-icon--red { background: var(--red-soft); color: var(--red-ink); }
.modal-icon--orange { background: var(--orange-soft); color: var(--orange-ink); }
.modal-icon--navy { background: var(--surface-3); color: var(--title); }
.modal-title { font-size: 20px; margin-bottom: 6px; padding-right: 32px; }
.modal-text { color: var(--muted); font-size: 14.5px; margin-bottom: 4px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.modal-close { position: absolute; top: 14px; right: 14px; }
body.has-modal { overflow: hidden; }

/* Link gerado */
.link-modal { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.link-field { display: flex; gap: 8px; }
.link-input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; background: var(--surface-2); }
.link-modal-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.link-share { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-share .btn { height: 46px; }

/* ---------- 10. Progresso, skeleton e estados vazios ---------- */
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #3DBDF0);
  transition: width 220ms var(--ease);
}
.progress-text { font-size: 13px; font-weight: 600; color: var(--title); font-variant-numeric: tabular-nums; }

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.skeleton--line { height: 12px; margin-bottom: 10px; }
.skeleton--title { height: 28px; width: min(420px, 80%); margin-bottom: 12px; border-radius: 10px; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.empty-art { width: 160px; margin-bottom: 8px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--title); }
.empty-text { max-width: 380px; font-size: 14px; color: var(--muted); margin-bottom: 8px; }

.ill { display: block; width: 100%; height: auto; }
.ill-bg { fill: var(--surface-3); }
.ill-card { fill: var(--blue-soft); stroke: var(--blue); stroke-width: 1.5; }
.ill-card2 { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.ill-fill { fill: var(--blue); opacity: .85; }
.ill-line { fill: var(--border-strong); }
.ill-ring { fill: none; stroke: var(--blue); stroke-width: 3; }
.ill-hand { fill: none; stroke: var(--navy); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .ill-hand { stroke: #fff; }
.ill-accent { fill: var(--orange); }
.ill-check { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ==========================================================================
   11. Login
   ========================================================================== */
.login-body {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 140, 203, .22), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(242, 92, 5, .12), transparent 40%),
    var(--navy);
}
.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 24px 24px;
}
.login-bg .sq { position: absolute; display: block; border-radius: 22px; }
.login-bg .sq-1 { width: 220px; height: 220px; top: -60px; left: -50px; border: 1px solid rgba(255, 255, 255, .1); transform: rotate(12deg); }
.login-bg .sq-2 { width: 120px; height: 120px; top: 18%; right: 9%; background: rgba(0, 140, 203, .2); transform: rotate(-8deg); }
.login-bg .sq-3 { width: 54px; height: 54px; bottom: 16%; left: 12%; background: var(--orange); border-radius: 12px; opacity: .85; transform: rotate(14deg); }
.login-bg .sq-4 { width: 300px; height: 300px; bottom: -120px; right: -80px; border: 1px solid rgba(255, 255, 255, .08); transform: rotate(-14deg); }
.login-bg .sq-5 { width: 72px; height: 72px; top: 62%; right: 22%; border: 1.5px solid rgba(0, 140, 203, .45); border-radius: 16px; transform: rotate(22deg); }

.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 40px 36px 28px;
  border-radius: 24px;
  background: #fff;
  color: #13233F;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.login-logo { margin-bottom: 28px; }
.login-title { font-size: 24px; color: var(--navy); }
.login-sub { margin: 6px 0 24px; color: #5B6B82; font-size: 14.5px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-form .input-group .input { padding-right: 48px; }
.login-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #E6EDF5;
  font-size: 12.5px;
  color: #5B6B82;
}

/* ==========================================================================
   12. Estrutura do app
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--preview-w);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Barra lateral */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  height: 100vh;
  height: 100dvh;
  padding: 20px 10px;
  background: var(--navy);
}
[data-theme="dark"] .sidebar { background: #00112B; border-right: 1px solid var(--border); }
.sidebar-brand {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .07);
}
.nav { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 4px 9px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, .7);
  font: 600 11px/1.2 var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 36px;
  border-radius: 11px;
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.nav-item.is-active { color: #fff; }
.nav-item.is-active .nav-icon { background: var(--blue); box-shadow: 0 6px 16px rgba(0, 140, 203, .35); }
.nav-item:focus-visible { outline-color: #fff; }
.nav-label { max-width: 72px; }
.nav-badge {
  position: absolute;
  top: 2px;
  right: 12px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font: 800 10.5px var(--font);
  box-shadow: 0 0 0 2px var(--navy);
}
.sidebar-foot { margin-top: auto; width: 100%; }

/* Área central */
.workspace { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 32px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.topbar-divider { width: 1px; height: 24px; background: var(--border-strong); }
.view-title { font-size: 14.5px; font-weight: 700; color: var(--title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.only-compact { display: none; }

.main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 32px 64px; }
.main:focus { outline: none; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.view-head h1 { font-size: 26px; letter-spacing: -.025em; }
.view-head p { margin-top: 6px; color: var(--muted); font-size: 14.5px; }

.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }

/* ==========================================================================
   13. Editor
   ========================================================================== */

/* Upload */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), padding var(--dur) var(--ease);
}
.dropzone:hover { border-color: var(--blue); background: var(--blue-soft); }
.dropzone.is-over {
  border-style: solid;
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 4px rgba(0, 140, 203, .14);
}
.dropzone-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--blue);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease);
}
.dropzone:hover .dropzone-icon, .dropzone.is-over .dropzone-icon { transform: translateY(-2px); }
.dropzone-title { font-weight: 600; color: var(--title); }
.dropzone-text { margin-top: 2px; font-size: 13px; color: var(--muted); }
.has-images .dropzone { flex-direction: row; justify-content: flex-start; padding: 14px 18px; text-align: left; }
.has-images .dropzone-icon { width: 42px; height: 42px; border-radius: 12px; }

/* Miniaturas */
.thumbs-wrap { position: relative; }
.has-images .thumbs-wrap { margin-top: 20px; }
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-3);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.thumb.is-selected { box-shadow: 0 0 0 2.5px var(--blue), var(--shadow); }
.thumb:focus-visible { outline-offset: 3px; }
.thumb-index {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 7px;
  background: rgba(0, 27, 68, .8);
  color: #fff;
  font: 700 11.5px var(--font);
}
.thumb.is-selected .thumb-index { background: var(--blue); }
.thumb-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.thumb:hover .thumb-actions, .thumb:focus-within .thumb-actions, .thumb.is-selected .thumb-actions { opacity: 1; }
.thumb-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  color: var(--navy);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.thumb-btn:hover { color: var(--primary); transform: scale(1.06); }
.thumb-btn--danger:hover { color: var(--red-ink); }
.thumb-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .94);
  color: var(--navy);
  font: 700 10.5px var(--font);
}
.thumb.is-drag-source { opacity: .3; transform: scale(.94); box-shadow: none; }
.thumb-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 350;
  margin: 0;
  pointer-events: none;
  opacity: .96;
  box-shadow: var(--shadow-lg), 0 0 0 2.5px var(--blue);
  transition: none;
}
.thumb-ghost .thumb-actions { display: none; }
.thumbs.is-sorting .thumb:not(.is-drag-source):hover { transform: none; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }

.thumb--add { background: transparent; box-shadow: none; border: 1.5px dashed var(--border-strong); cursor: default; touch-action: auto; }
.thumb--add:hover { transform: none; box-shadow: none; border-color: var(--blue); }
.thumb-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 12px var(--font);
  cursor: pointer;
}
.thumb-add:hover { color: var(--link); }

.drop-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  border-radius: 4px;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 140, 203, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms var(--ease);
}
.drop-indicator::before, .drop-indicator::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--blue);
}
.drop-indicator::before { top: -5px; }
.drop-indicator::after { bottom: -5px; }
.drop-indicator.is-visible { opacity: 1; }

/* Formato e enquadramento */
.format-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.crop-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  color: var(--muted);
  font-size: 14px;
}
.crop-empty-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-3); color: var(--muted); }
.crop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.crop-stage {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 24px;
  border-radius: 14px;
  background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface-2) 0 50%) 0 0 / 18px 18px;
}
.crop-frame {
  position: relative;
  width: 100%;
  max-width: 300px;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 27, 68, .1), var(--shadow);
  cursor: grab;
  touch-action: none;
}
.crop-frame.is-dragging { cursor: grabbing; }
.crop-frame img { position: absolute; max-width: none; pointer-events: none; -webkit-user-select: none; user-select: none; }
.crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .7) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .7) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  background-position: -1px -1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
  transition: opacity var(--dur) var(--ease);
}
.crop-frame:hover .crop-grid, .crop-frame.is-dragging .crop-grid, .crop-frame:focus-visible .crop-grid { opacity: 1; }
.crop-controls { display: flex; flex-direction: column; gap: 20px; }
.crop-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.crop-label { font-weight: 700; color: var(--title); font-size: 14px; }
.zoom-row { display: flex; align-items: center; gap: 6px; }
.zoom-value { min-width: 46px; text-align: right; font: 700 13px var(--font); color: var(--title); font-variant-numeric: tabular-nums; }
.crop-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crop-tip { display: flex; align-items: center; gap: 6px; }

/* Legenda */
.caption-meter { position: relative; height: 4px; margin-top: 12px; border-radius: 4px; background: var(--surface-3); }
.caption-meter-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width var(--dur) var(--ease); }
.caption-meter-fill.is-over { background: var(--red); }
.caption-meter-cut {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 12px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--orange);
}
.caption-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.counter { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.counter.is-warn { color: var(--orange-ink); }
.counter.is-over { color: var(--red-ink); }

/* Barra de publicação */
.publish-bar {
  position: sticky;
  bottom: 16px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  padding: 14px 14px 14px 24px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.publish-bar { flex-wrap: wrap; }
.publish-info { flex: 1 1 200px; min-width: 0; }
.publish-title { font-weight: 700; color: var(--title); font-size: 15px; }
.publish-sub { margin-top: 2px; font-size: 13px; color: var(--muted); }
.publish-progress { display: flex; flex-direction: column; gap: 8px; }
.publish-controls { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: 12px; flex: 0 1 auto; margin-left: auto; }
.publish-expiry { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.publish-controls .btn--ghost { align-self: center; }
body.is-publishing .editor-grid, body.is-publishing #newDraftBtn { pointer-events: none; opacity: .6; transition: opacity var(--dur) var(--ease); }
body.is-loading-link .editor-grid { opacity: .5; pointer-events: none; }

/* Perfil */
.avatar-upload { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.avatar-preview {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--placeholder);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--border);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.col-6 { grid-column: span 6; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }

.grid-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.grid-slot {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-3);
}
.grid-slot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.grid-slot--empty {
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--border-strong);
  background: var(--surface-2);
  color: var(--placeholder);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.grid-slot--empty:hover { border-color: var(--blue); color: var(--link); }
.grid-slot-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: var(--navy);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.grid-slot-remove:hover { color: var(--red-ink); }
.grid-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

/* Meus links */
.links-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.links-list { display: flex; flex-direction: column; gap: 16px; }
.link-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 18px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.link-card:hover { box-shadow: var(--shadow-lg); }
.link-card.is-editing { box-shadow: 0 0 0 2px var(--blue), var(--shadow); }
.link-card--skeleton { grid-template-columns: 96px minmax(0, 1fr); }
.link-cover {
  position: relative;
  width: 96px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-3);
}
.link-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.link-cover-count {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font: 700 11px var(--font);
}
.link-main { min-width: 0; }
.link-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.chip-ver {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--title);
  font: 700 12px var(--font);
}
.chip-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.chip-meta.is-expired { color: var(--red-ink); font-weight: 700; }
.chip-editing {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--link);
  font: 700 12px var(--font);
}
.link-caption {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--title);
  overflow-wrap: anywhere;
}
.link-caption.is-muted { color: var(--muted); font-weight: 500; font-style: italic; }
.link-meta { font-size: 12.5px; color: var(--muted); }
.link-feedback {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.link-feedback-icon { margin-top: 1px; }
.link-feedback--approved .link-feedback-icon { color: var(--green-ink); }
.link-feedback--changes { background: var(--red-soft); border-color: transparent; }
.link-feedback--changes .link-feedback-icon { color: var(--red-ink); }
.link-feedback-body { min-width: 0; }
.link-feedback-title { font-size: 12.5px; font-weight: 700; color: var(--title); }
.link-feedback-text { margin-top: 4px; font-size: 13.5px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.link-history { margin-top: 12px; }
.link-history summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--link);
  cursor: pointer;
  list-style: none;
}
.link-history summary::-webkit-details-marker { display: none; }
.history-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); list-style: none; }
.history-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.history-head strong { color: var(--title); }
.history-comment { margin-top: 4px; font-size: 13px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.link-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.link-actions-row { display: flex; gap: 2px; }
#linksRefresh.is-loading .icon-slot { animation: spin .8s linear infinite; }

/* ==========================================================================
   14. Painel de preview
   ========================================================================== */
.preview-pane {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  border-left: 1px solid var(--border);
  background: var(--surface);
}
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--topbar-h); padding: 0 20px; border-bottom: 1px solid var(--border); }
.preview-heading { display: flex; align-items: baseline; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); align-self: center; animation: pulse 2s ease infinite; }
.preview-title { font-weight: 700; color: var(--title); }
.preview-sub { font-size: 12.5px; color: var(--muted); }
.preview-close { display: none; }
.pv-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.pv-tools { display: flex; gap: 6px; }
.preview-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  padding: 4px 20px 8px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, var(--blue-soft), transparent 65%);
}
.pv-root { width: 100%; height: 100%; }
.preview-foot { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px 14px; font-size: 12px; color: var(--muted); }

/* Tela cheia */
.preview-pane.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  border: 0;
  background: rgba(0, 14, 36, .94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transform: none;
}
.preview-pane.is-fullscreen .preview-head { border-color: rgba(255, 255, 255, .08); }
.preview-pane.is-fullscreen .preview-title { color: #fff; }
.preview-pane.is-fullscreen .preview-sub, .preview-pane.is-fullscreen .preview-foot { color: rgba(255, 255, 255, .6); }
.preview-pane.is-fullscreen .preview-close { display: inline-grid; color: #fff; }
.preview-pane.is-fullscreen .preview-close:hover { background: rgba(255, 255, 255, .1); }
.preview-pane.is-fullscreen .pv-toolbar { justify-content: center; gap: 16px; }
.preview-pane.is-fullscreen .preview-stage { overflow-y: auto; background: none; padding: 8px 16px 32px; }
.preview-pane.is-fullscreen .pv-root { height: auto; }
.preview-pane.is-fullscreen kbd { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .2); box-shadow: none; }
body.has-fullscreen { overflow: hidden; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(0, 14, 36, .5);
  opacity: 0;
  transition: opacity 250ms var(--ease);
}
.sheet-backdrop.is-visible { opacity: 1; }

/* ==========================================================================
   15. Mockup do Instagram
   ========================================================================== */
.pv { position: relative; display: flex; justify-content: center; align-items: flex-start; }
.pv-fit { position: relative; flex: none; }
.pv-device {
  position: absolute;
  top: 0;
  left: 0;
  width: 402px;
  height: 852px;
  padding: 11px;
  border-radius: 60px;
  background: linear-gradient(150deg, #2A3242, #0B0F17 55%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .1), 0 0 0 1px #05070B, 0 30px 60px rgba(0, 27, 68, .28);
  transform-origin: 0 0;
}
.pv-island {
  position: absolute;
  top: 23px;
  left: 50%;
  z-index: 5;
  width: 120px;
  height: 34px;
  margin-left: -60px;
  border-radius: 20px;
  background: #000;
}

.ig {
  --ig-bg: #FFFFFF;
  --ig-text: #000000;
  --ig-muted: #737373;
  --ig-border: #DBDBDB;
  --ig-elev: #EFEFEF;
  --ig-link: #00376B;
  --ig-blue: #0095F6;
  --ig-placeholder: #EFEFEF;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 49px;
  background: var(--ig-bg);
  color: var(--ig-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 18px;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.ig[data-theme="dark"] {
  --ig-bg: #000000;
  --ig-text: #F5F5F5;
  --ig-muted: #A8A8A8;
  --ig-border: #262626;
  --ig-elev: #262626;
  --ig-link: #E0F1FF;
  --ig-placeholder: #1F1F1F;
}
.ig p { margin: 0; }
.ig-ico { display: block; flex-shrink: 0; }

.ig-status { display: flex; align-items: center; justify-content: space-between; flex: none; height: 54px; padding: 8px 32px 0 44px; font-weight: 600; font-size: 16px; }
.ig-status-icons { display: flex; align-items: center; gap: 6px; }
.ig-screen { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ig-topbar { display: flex; align-items: center; justify-content: space-between; flex: none; height: 50px; padding: 0 16px; }
.ig-wordmark { font-family: 'Grand Hotel', 'Snell Roundhand', 'Segoe Script', cursive; font-size: 30px; line-height: 1; padding-top: 6px; }
.ig-top-icons { display: flex; align-items: center; gap: 20px; }
.ig-scroll { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
.ig-scroll::-webkit-scrollbar { display: none; }

/* Post */
.ig-post-head { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 8px 0 12px; }
.ig-ring {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(45deg, #FEDA75, #FA7E1E, #D62976, #962FBF, #4F5BD5);
}
.ig-ring .ig-avatar { width: 34px; height: 34px; box-shadow: 0 0 0 2px var(--ig-bg); }
.ig-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--ig-placeholder);
  color: var(--ig-muted);
}
.ig-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ig-post-user { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.ig-dots-btn { display: grid; place-items: center; width: 32px; height: 32px; }

.ig-media {
  position: relative;
  width: 100%;
  aspect-ratio: var(--pv-ratio, .8);
  overflow: hidden;
  background: var(--ig-placeholder);
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
}
.ig-media:active { cursor: grabbing; }
.ig-media:focus { outline: none; }
.ig-media:focus-visible { box-shadow: inset 0 0 0 3px var(--ig-blue); }
.ig-track { display: flex; height: 100%; transition: transform 320ms cubic-bezier(.25, .8, .25, 1); will-change: transform; }
.ig-track.is-dragging { transition: none; }
.ig-slide { position: relative; flex: 0 0 100%; height: 100%; overflow: hidden; background: var(--ig-bg); }
.ig-slide img, .ig-cell-frame img { position: absolute; max-width: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.ig-empty {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--ig-muted);
  font-size: 13px;
  text-align: center;
}
.ig-media.is-empty { cursor: default; }
.ig-media.is-empty .ig-empty { display: flex; }
.ig-counter {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 9px;
  border-radius: 13px;
  background: rgba(26, 26, 26, .8);
  color: #F9F9F9;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  pointer-events: none;
}
.ig-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  color: #262626;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms var(--ease), transform 150ms var(--ease);
}
.ig-arrow:hover { transform: scale(1.08); }
.ig-arrow--prev { left: 10px; }
.ig-arrow--next { right: 10px; }
.ig-media:hover .ig-arrow, .ig-arrow:focus-visible { opacity: 1; }
@media (hover: none) { .ig-arrow { display: none; } }

.ig-actions { position: relative; display: flex; align-items: center; justify-content: space-between; height: 46px; padding: 0 10px 0 12px; }
.ig-actions-left { display: flex; gap: 14px; }
.ig-dots { position: absolute; top: 50%; left: 50%; display: flex; align-items: center; gap: 4px; transform: translate(-50%, -50%); }
.ig-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ig-text); opacity: .25; transition: all 200ms var(--ease); }
.ig-dot.is-active { background: var(--ig-blue); opacity: 1; }
.ig-dot.is-small { transform: scale(.66); }
.ig-body { padding: 0 14px 16px; }
.ig-caption { white-space: pre-wrap; overflow-wrap: anywhere; }
.ig-caption-user { font-weight: 600; }
.ig-caption-empty { color: var(--ig-muted); }
.ig-tag { color: var(--ig-link); }
.ig-more { padding: 0; border: 0; background: none; color: var(--ig-muted); font: inherit; cursor: pointer; }
.ig-more:hover { text-decoration: underline; }
.ig-comments { margin-top: 6px !important; color: var(--ig-muted); }
.ig-time { margin-top: 6px !important; color: var(--ig-muted); font-size: 11.5px; letter-spacing: .01em; }
.ig-next-post { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid var(--ig-border); opacity: .55; }
.ig-next-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ig-placeholder); }
.ig-next-line { width: 110px; height: 10px; border-radius: 5px; background: var(--ig-placeholder); }

/* Perfil */
.ig-prof-handle { display: inline-flex; align-items: center; gap: 4px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.ig-prof { padding: 4px 16px 0; }
.ig-prof-row { display: flex; align-items: center; gap: 22px; }
.ig-avatar--lg { width: 86px; height: 86px; }
.ig-prof-right { flex: 1; min-width: 0; }
.ig-prof-name { margin-bottom: 6px !important; overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.ig-stats { display: flex; justify-content: space-between; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ig-stats li { display: flex; flex-direction: column; line-height: 1.25; }
.ig-stats b { font-size: 16px; font-weight: 600; }
.ig-stats span { font-size: 13px; }
.ig-bio { margin-top: 10px !important; white-space: pre-wrap; overflow-wrap: anywhere; }
.ig-prof-buttons { display: flex; gap: 6px; margin: 14px 0 12px; }
.ig-btn { display: grid; place-items: center; flex: 1; height: 32px; border-radius: 8px; background: var(--ig-elev); font-weight: 600; font-size: 14px; }
.ig-btn--primary { background: var(--ig-blue); color: #fff; }
.ig-btn--icon { flex: 0 0 34px; }
.ig-tabs { display: flex; border-bottom: 1px solid var(--ig-border); }
.ig-tab { display: grid; place-items: center; flex: 1; height: 44px; color: var(--ig-muted); border-bottom: 1px solid transparent; margin-bottom: -1px; }
.ig-tab.is-active { color: var(--ig-text); border-bottom: 1.5px solid var(--ig-text); }
.ig-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding-top: 2px; }
.ig-cell {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: var(--ig-placeholder);
}
.ig-cell > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ig-cell--new { cursor: pointer; }
.ig-cell--new:focus-visible { outline: 2px solid var(--ig-blue); outline-offset: -2px; }
.ig-cell-frame { position: absolute; top: 0; left: 50%; height: 100%; aspect-ratio: var(--pv-ratio, .8); overflow: hidden; transform: translateX(-50%); background: var(--ig-bg); }
.ig-carousel-ico { position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .4)); }

/* Navegação inferior */
.ig-nav { display: flex; justify-content: space-around; align-items: flex-start; flex: none; height: 84px; padding-top: 12px; border-top: 1px solid var(--ig-border); background: var(--ig-bg); }
.ig-nav > span { display: grid; place-items: center; width: 40px; height: 30px; }
.ig-nav-avatar { width: 26px !important; height: 26px !important; margin-top: 2px; }
.ig-nav-avatar.is-active { box-shadow: 0 0 0 2px var(--ig-bg), 0 0 0 3.5px var(--ig-text); }
.ig-home-indicator { position: absolute; bottom: 8px; left: 50%; width: 134px; height: 5px; margin-left: -67px; border-radius: 3px; background: var(--ig-text); }

/* Moldura "tela cheia": só o conteúdo, largura de celular */
.pv[data-frame="full"] .pv-fit { width: 100%; max-width: 470px; }
.pv[data-frame="full"] .pv-device { position: relative; width: 100%; height: auto; padding: 0; border-radius: 0; background: none; box-shadow: none; transform: none; }
.pv[data-frame="full"] .pv-island,
.pv[data-frame="full"] .ig-status,
.pv[data-frame="full"] .ig-nav,
.pv[data-frame="full"] .ig-home-indicator { display: none; }
.pv[data-frame="full"] .ig { height: auto; border-radius: 16px; box-shadow: 0 0 0 1px var(--border), var(--shadow); }
.pv[data-frame="full"] .ig-scroll { overflow: visible; }
.pv[data-frame="full"] .ig-topbar { border-bottom: 1px solid var(--ig-border); }

/* ==========================================================================
   16. Responsivo
   ========================================================================== */
@media (max-width: 1360px) {
  :root { --preview-w: 420px; }
  .grid-12 > [class*="span-"] { grid-column: span 12; }
}

@media (max-width: 1180px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .only-compact { display: inline-flex; }
  .preview-pane {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    width: min(460px, 100%);
    box-shadow: var(--shadow-lg);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 260ms var(--ease), visibility 0s linear 260ms;
  }
  .preview-pane.is-open { transform: none; visibility: visible; transition: transform 260ms var(--ease), visibility 0s; }
  .preview-pane.is-fullscreen { width: 100%; visibility: visible; }
  .preview-close { display: inline-grid; }
  body.has-sheet { overflow: hidden; }
}

@media (max-width: 980px) {
  .crop { grid-template-columns: 1fr; }
  .publish-bar { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px; }
  .publish-controls { flex-wrap: wrap; align-items: stretch; }
  .publish-expiry { flex: 1 1 140px; }
  .publish-controls .btn--cta { flex: 1 1 260px; }
  .link-card { grid-template-columns: 80px minmax(0, 1fr); }
  .link-cover { width: 80px; }
  .link-actions { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); }
}

@media (max-width: 760px) {
  :root { --sidebar-w: 0px; --topbar-h: 60px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    flex-direction: row;
    height: auto;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    gap: 0;
    box-shadow: 0 -8px 24px rgba(0, 27, 68, .18);
  }
  .sidebar-brand { display: none; }
  .nav { flex-direction: row; flex: 3; gap: 2px; }
  .sidebar-foot { flex: 1; margin: 0; }
  .nav-item { padding: 6px 2px; font-size: 10.5px; }
  .nav-icon { width: 44px; height: 30px; }
  .nav-badge { right: calc(50% - 30px); }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar-divider, .view-title { display: none; }
  .brand-logo { height: 28px; }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .view-head h1 { font-size: 22px; }
  .card { padding: 18px; }
  .card-heading { gap: 12px; }
  .banner { flex-wrap: wrap; }
  .banner-actions { width: 100%; }
  .publish-bar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .btn--cta { height: 52px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-6, .col-3 { grid-column: span 2; }
  .col-2 { grid-column: span 1; }
  .col-2:last-child { grid-column: span 2; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
  .thumb-actions { opacity: 1; }
  .toasts { right: 16px; left: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { min-width: 0; max-width: none; }
  .link-share { grid-template-columns: 1fr; }
  .link-field { flex-direction: column; }
  .modal { padding: 24px 20px; }
}

@media (hover: none) {
  .thumb-actions { opacity: 1; }
  .btn:hover, .thumb:hover { transform: none; }
}

/* Folha inferior (modais em telas pequenas) */
@media (max-width: 640px) {
  .modal-backdrop--sheet { place-items: end stretch; padding: 0; }
  .modal-backdrop--sheet .modal {
    width: 100%;
    max-height: 92dvh;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
  }
  .modal-backdrop--sheet.is-open .modal { transform: none; }
  .modal-backdrop--sheet .modal::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    margin: -8px auto 16px;
    border-radius: 2px;
    background: var(--border-strong);
  }
  .modal-backdrop--sheet .modal-actions { display: grid; grid-template-columns: 1fr 1.6fr; }
  .modal-backdrop--sheet .modal-actions .btn { height: 48px; }
}

/* ---------- 17. Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
