/* LL Swipe Dashboard — visual inspirado no macOS/iOS: superfícies calmas, vidro, tipografia precisa. */

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --mono: 'SF Mono', ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;

  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --sidebar: rgba(240, 240, 244, 0.78);
  --glass: rgba(255, 255, 255, 0.72);
  --label: #1d1d1f;
  --label-2: #515154;
  --label-3: #86868b;
  --label-4: #aeaeb2;
  --separator: rgba(60, 60, 67, 0.12);
  --separator-strong: rgba(60, 60, 67, 0.2);
  --fill: rgba(120, 120, 128, 0.1);
  --fill-2: rgba(120, 120, 128, 0.16);
  --fill-hover: rgba(120, 120, 128, 0.14);
  --seg-on: #ffffff;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --accent-text: #0066cc;
  --green: #248a3d;
  --green-soft: rgba(52, 199, 89, 0.14);
  --orange: #c93400;
  --orange-soft: rgba(255, 149, 0, 0.16);
  --red: #d70015;
  --red-soft: rgba(255, 59, 48, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.02);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
  --card-border: rgba(0, 0, 0, 0.04);
  --focus: 0 0 0 4px rgba(0, 113, 227, 0.22);
  --switch-on: #34c759;

  --meta: #af52de;
  --tiktok: #30b350;
  --taboola: #ff9500;
  --youtube: #ff3b30;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 22px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --surface: #161618;
    --surface-2: #1c1c1e;
    --sidebar: rgba(28, 28, 30, 0.72);
    --glass: rgba(22, 22, 24, 0.72);
    --label: #f5f5f7;
    --label-2: #c7c7cc;
    --label-3: #8e8e93;
    --label-4: #636366;
    --separator: rgba(84, 84, 88, 0.42);
    --separator-strong: rgba(84, 84, 88, 0.65);
    --fill: rgba(118, 118, 128, 0.18);
    --fill-2: rgba(118, 118, 128, 0.26);
    --fill-hover: rgba(118, 118, 128, 0.24);
    --seg-on: #636366;
    --accent: #0a84ff;
    --accent-hover: #2391ff;
    --accent-soft: rgba(10, 132, 255, 0.18);
    --accent-text: #4aa3ff;
    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.16);
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, 0.16);
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, 0.16);
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
    --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 90px rgba(0, 0, 0, 0.6);
    --card-border: rgba(255, 255, 255, 0.06);
    --focus: 0 0 0 4px rgba(10, 132, 255, 0.35);
    --switch-on: #30d158;
    --meta: #bf5af2;
    --tiktok: #30d158;
    --taboola: #ff9f0a;
    --youtube: #ff453a;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --surface: #161618;
  --surface-2: #1c1c1e;
  --sidebar: rgba(28, 28, 30, 0.72);
  --glass: rgba(22, 22, 24, 0.72);
  --label: #f5f5f7;
  --label-2: #c7c7cc;
  --label-3: #8e8e93;
  --label-4: #636366;
  --separator: rgba(84, 84, 88, 0.42);
  --separator-strong: rgba(84, 84, 88, 0.65);
  --fill: rgba(118, 118, 128, 0.18);
  --fill-2: rgba(118, 118, 128, 0.26);
  --fill-hover: rgba(118, 118, 128, 0.24);
  --seg-on: #636366;
  --accent: #0a84ff;
  --accent-hover: #2391ff;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --accent-text: #4aa3ff;
  --green: #30d158;
  --green-soft: rgba(48, 209, 88, 0.16);
  --orange: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, 0.16);
  --red: #ff453a;
  --red-soft: rgba(255, 69, 58, 0.16);
  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 90px rgba(0, 0, 0, 0.6);
  --card-border: rgba(255, 255, 255, 0.06);
  --focus: 0 0 0 4px rgba(10, 132, 255, 0.35);
  --switch-on: #30d158;
  --meta: #bf5af2;
  --tiktok: #30d158;
  --taboola: #ff9f0a;
  --youtube: #ff453a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--label);
  font: 400 14px/1.45 var(--font);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent-soft); }
.muted { color: var(--label-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- layout */

.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px 14px; background: var(--sidebar); border-right: 1px solid var(--separator);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); z-index: 5;
}
.main { min-width: 0; }
.page { max-width: 1240px; margin: 0 auto; padding: 36px 40px 120px; animation: fade-in 0.35s var(--ease); }
.page.narrow { max-width: 860px; }

.page-header { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--label-3); margin-bottom: 4px; }
.large-title { margin: 0; font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.028em; }
.subtitle { margin: 6px 0 0; color: var(--label-3); font-size: 15px; }
.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- sidebar */

.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 6px; }
.app-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(160deg, #3a3a3c 0%, #111113 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(0, 0, 0, 0.2), 0 6px 14px rgba(0, 0, 0, 0.18);
  color: #fff; font-weight: 800; font-size: 13px; letter-spacing: -0.04em;
}
.app-icon.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.015em; }
.brand-sub { font-size: 12px; color: var(--label-3); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; font-weight: 600; color: var(--label-3); padding: 10px 10px 4px; letter-spacing: 0.02em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; border: 0; background: none;
  color: var(--label); font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer; width: 100%;
  transition: background 0.15s;
}
.nav-item svg { color: var(--accent); flex: none; }
.nav-item:hover { background: var(--fill); text-decoration: none; }
.nav-item.active { background: var(--fill-2); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.nav-item .dot { margin: 0 3px; }

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.bot-pill {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--glass);
  border: 1px solid var(--card-border); box-shadow: var(--shadow-sm);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(160deg, #48484a, #1c1c1e); color: #fff; font-size: 11px; font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.bot-pill .who { min-width: 0; flex: 1; }
.bot-pill .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-pill .state { font-size: 11.5px; color: var(--label-3); display: flex; align-items: center; gap: 5px; }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--switch-on); box-shadow: 0 0 0 3px var(--green-soft); }
.live.off { background: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.live.err { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

/* ---------------------------------------------------------------- superfícies */

.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid var(--card-border); }
.card-pad { padding: 20px; }
.group { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid var(--card-border); overflow: hidden; }
.group + .group, .group-title + .group { margin-top: 0; }
.group-title { font-size: 12px; font-weight: 600; color: var(--label-3); text-transform: uppercase; letter-spacing: 0.06em; margin: 26px 4px 8px; display: flex; align-items: center; gap: 8px; }
.group-title:first-child { margin-top: 0; }
.group-foot { font-size: 12.5px; color: var(--label-3); margin: 8px 4px 0; line-height: 1.5; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 48px; position: relative; }
.row + .row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--separator); }
.row-label { flex: 1; min-width: 0; }
.row-label .t { font-weight: 500; }
.row-label .d { font-size: 12.5px; color: var(--label-3); margin-top: 1px; }
.row-value { color: var(--label-3); font-size: 13.5px; }

/* ---------------------------------------------------------------- formulários */

.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 14px; }
.label { font-size: 12.5px; font-weight: 600; color: var(--label-2); }
.hint { font-size: 12px; color: var(--label-3); }
.input, .textarea, .select {
  width: 100%; border: 0; outline: 0; background: var(--fill); border-radius: 10px; padding: 9px 12px;
  min-height: 38px; transition: box-shadow 0.15s, background 0.15s; color: var(--label);
}
.input::placeholder, .textarea::placeholder { color: var(--label-4); }
.input:hover, .textarea:hover, .select:hover { background: var(--fill-hover); }
.input:focus, .textarea:focus, .select:focus { box-shadow: var(--focus); background: var(--surface); }
.textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.4' 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 11px center; }
.input.title-input { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; min-height: 50px; padding: 10px 14px; }
.input.mono { font-family: var(--mono); font-size: 12.5px; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row > .input { flex: 1; }

/* ---------------------------------------------------------------- botões */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; cursor: pointer;
  border-radius: 980px; padding: 8px 16px; min-height: 34px; font-size: 13.5px; font-weight: 550; white-space: nowrap;
  background: var(--fill); color: var(--label); transition: background 0.15s, transform 0.1s, opacity 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--fill-hover); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 0; box-shadow: var(--focus); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.tinted { background: var(--accent-soft); color: var(--accent-text); }
.btn.tinted:hover { background: var(--accent-soft); filter: brightness(0.97); }
.btn.plain { background: none; color: var(--accent-text); padding-left: 8px; padding-right: 8px; }
.btn.plain:hover { background: var(--accent-soft); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.lg { min-height: 42px; padding: 10px 22px; font-size: 15px; }
.btn.sm { min-height: 28px; padding: 5px 11px; font-size: 12.5px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; color: var(--label-3); cursor: pointer;
  display: inline-grid; place-items: center; transition: background 0.15s, color 0.15s; flex: none;
}
.icon-btn:hover { background: var(--fill); color: var(--label); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* segmented control */
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: none; border-radius: 7px; padding: 6px 13px; font-size: 13px; font-weight: 500; cursor: pointer;
  color: var(--label); display: inline-flex; align-items: center; gap: 7px; transition: background 0.18s, box-shadow 0.18s;
}
.seg button:hover:not(.on) { background: var(--fill); }
.seg button.on { background: var(--seg-on); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.04); font-weight: 600; }
.seg.full { display: flex; }
.seg.full button { flex: 1; justify-content: center; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--label-4); }
.dot.platform-meta { background: var(--meta); } .dot.platform-tiktok { background: var(--tiktok); }
.dot.platform-taboola { background: var(--taboola); } .dot.platform-youtube { background: var(--youtube); }

/* chips de nicho */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 0; background: var(--fill); border-radius: 980px; padding: 6px 12px; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s, color 0.15s, box-shadow 0.15s; color: var(--label);
}
.chip:hover { background: var(--fill-hover); }
.chip.on { background: var(--accent); color: #fff; }
.chip .e { font-size: 14px; line-height: 1; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }

/* switch iOS */
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 26px; background: var(--fill-2); transition: background 0.2s; }
.switch span::after {
  content: ''; position: absolute; left: 2px; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.04); transition: transform 0.25s var(--ease);
}
.switch input:checked + span { background: var(--switch-on); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

/* pills de status */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 980px; background: var(--fill); color: var(--label-2); white-space: nowrap; }
.pill.tag { letter-spacing: 0.03em; }
.pill.published { background: var(--green-soft); color: var(--green); }
.pill.scheduled { background: var(--accent-soft); color: var(--accent-text); }
.pill.uncertain, .pill.deleted { background: var(--orange-soft); color: var(--orange); }
.pill.failed { background: var(--red-soft); color: var(--red); }
.pill.new { background: var(--accent-soft); color: var(--accent-text); }

/* ---------------------------------------------------------------- compositor */

.composer { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 28px; align-items: start; }
.composer-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.composer-preview { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid var(--card-border); padding: 18px 20px; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--label-3); }
.panel-head .spacer + * { margin-left: auto; }
.tag-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.tag-row .input { width: 120px; min-height: 30px; padding: 5px 10px; font-size: 13px; }

.section-card { padding: 16px 18px; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.section-title-input {
  border: 0; background: none; outline: 0; font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--label);
  padding: 4px 6px; margin-left: -6px; border-radius: 6px; text-transform: uppercase; min-width: 0; flex: 1;
}
.section-title-input:hover { background: var(--fill); }
.section-title-input:focus { background: var(--fill); box-shadow: var(--focus); }
.role-badge { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; padding: 2px 7px; border-radius: 6px; background: var(--fill); color: var(--label-3); }
.role-badge.ad { background: var(--accent-soft); color: var(--accent-text); }
.role-badge.vsl { background: rgba(175, 82, 222, 0.14); color: var(--meta); }
.items { display: flex; flex-direction: column; gap: 8px; }
.item-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: start; }
.item-row .arrow { color: var(--label-4); font-size: 15px; line-height: 38px; text-align: center; }
.perf-grid { display: grid; grid-template-columns: minmax(90px, 1fr) auto minmax(90px, 120px); gap: 8px; align-items: center; }
.perf-grid .wide { grid-column: 1 / -1; }
.add-item { align-self: flex-start; margin-top: 4px; }
.add-section { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.dropzone {
  border: 1.5px dashed var(--separator-strong); border-radius: var(--r); padding: 22px; text-align: center; cursor: pointer;
  color: var(--label-3); transition: border-color 0.15s, background 0.15s; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.dropzone strong { color: var(--label); font-weight: 600; }
.dropzone kbd { font-family: var(--font); font-size: 11.5px; padding: 1px 6px; border-radius: 5px; background: var(--fill-2); color: var(--label-2); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--fill); cursor: grab; box-shadow: var(--shadow-sm); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.dragging { opacity: 0.4; }
.thumb .x {
  position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, 0.55); color: #fff; display: grid; place-items: center; backdrop-filter: blur(8px); opacity: 0; transition: opacity 0.15s;
}
.thumb:hover .x { opacity: 1; }
.thumb .n { position: absolute; left: 6px; bottom: 6px; font-size: 10.5px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.5); padding: 1px 6px; border-radius: 6px; backdrop-filter: blur(8px); }
.thumb .file { display: grid; place-items: center; height: 100%; font-size: 11px; color: var(--label-3); padding: 6px; text-align: center; }

.composer-bar {
  position: sticky; bottom: 16px; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px;
  background: var(--glass); border-radius: 18px; border: 1px solid var(--card-border); box-shadow: var(--shadow-lg);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); flex-wrap: wrap;
}
.counter { font-size: 12.5px; color: var(--label-3); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.meter { width: 64px; height: 4px; border-radius: 4px; background: var(--fill-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.2s; }
.meter.warn i { background: var(--orange); }
.meter.over i { background: var(--red); }
.counter.over { color: var(--red); font-weight: 600; }

.notice-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--accent-soft); color: var(--label); }
.notice-banner.warn { background: var(--orange-soft); }
.notice-banner.err { background: var(--red-soft); }
.notice-banner svg { flex: none; margin-top: 1px; color: var(--accent-text); }
.notice-banner.warn svg { color: var(--orange); }
.notice-banner.err svg { color: var(--red); }
.notice-banner .t { font-weight: 600; }
.notice-banner .d { font-size: 13px; color: var(--label-2); margin-top: 2px; }
.notice-banner .acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- prévia estilo Discord */

.dc { background: #1a1a1e; color: #dbdee1; border-radius: var(--r-lg); padding: 16px 16px 18px; font-size: 14.5px; line-height: 1.375; box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, 0.06); color-scheme: dark; }
.dc-chan { display: flex; align-items: center; gap: 6px; color: #949ba4; font-size: 13px; font-weight: 600; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.dc-chan b { color: #f2f3f5; }
.dc-msg { display: grid; grid-template-columns: 40px 1fr; gap: 0 14px; }
.dc-msg + .dc-msg { margin-top: 18px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(160deg, #3a3a3c, #0d0d0f); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; letter-spacing: -0.04em; overflow: hidden; }
.dc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.dc-name { color: #f2f3f5; font-weight: 600; font-size: 15px; }
.dc-badge { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 4px; border-radius: 3px; line-height: 15px; }
.dc-time { color: #949ba4; font-size: 12px; margin-left: 2px; }
.dc-body { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.dc-body .ln { min-height: 1.375em; }
.dc-link { color: #00a8fc; }
.dc-sub { font-size: 12px; color: #949ba4; }
.dc-edited { font-size: 10px; color: #949ba4; margin-left: 4px; }
.dc-reply { grid-column: 2; display: flex; align-items: center; gap: 6px; font-size: 13px; color: #949ba4; margin: 0 0 4px; position: relative; min-width: 0; }
.dc-reply::before { content: ''; position: absolute; left: -36px; top: 9px; width: 30px; height: 12px; border-left: 2px solid #4e5058; border-top: 2px solid #4e5058; border-top-left-radius: 6px; }
.dc-reply .mini { width: 16px; height: 16px; border-radius: 50%; background: #3a3a3c; flex: none; }
.dc-reply b { color: #f2f3f5; font-weight: 600; }
.dc-reply span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-gallery { display: grid; gap: 4px; margin-top: 8px; max-width: 400px; border-radius: 8px; overflow: hidden; }
.dc-gallery img { width: 100%; height: 100%; object-fit: cover; background: #2b2d31; }
.dc-gallery.n1 { grid-template-columns: 1fr; }
.dc-gallery.n1 img { max-height: 300px; object-fit: contain; background: transparent; }
.dc-gallery.n2 { grid-template-columns: 1fr 1fr; grid-auto-rows: 180px; }
.dc-gallery.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 120px 120px; }
.dc-gallery.n3 img:first-child { grid-row: span 2; }
.dc-gallery.n4 { grid-template-columns: 1fr 1fr; grid-auto-rows: 130px; }
.dc-gallery.nmany { grid-template-columns: 1fr 1fr 1fr; grid-auto-rows: 110px; }
.dc-empty { color: #6d6f78; font-style: italic; }

/* ---------------------------------------------------------------- biblioteca */

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--label-3); pointer-events: none; }
.search .input { padding-left: 34px; border-radius: 10px; }
.niche-bar { margin-bottom: 24px; }

.group-head { display: flex; align-items: baseline; gap: 10px; margin: 30px 2px 12px; }
.group-head:first-of-type { margin-top: 6px; }
.group-head h3 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.018em; display: flex; align-items: center; gap: 8px; }
.group-head .n { color: var(--label-3); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.post-card {
  background: var(--surface); border-radius: var(--r-lg); overflow: hidden; cursor: pointer; text-align: left; border: 1px solid var(--card-border);
  box-shadow: var(--shadow); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); padding: 0; display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 16px 40px rgba(0, 0, 0, 0.08); }
.post-card:focus-visible { outline: 0; box-shadow: var(--focus); }
.post-thumb { aspect-ratio: 16 / 10; background: var(--fill); position: relative; overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 750; letter-spacing: -0.04em; color: rgba(255, 255, 255, 0.92); }
.post-thumb .corner { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.post-thumb .corner .pill { background: rgba(0, 0, 0, 0.5); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.post-thumb .corner .pill.status-pill.published { display: none; }
.post-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 6px; }
.post-title { font-weight: 650; font-size: 15px; letter-spacing: -0.012em; display: flex; align-items: center; gap: 8px; }
.post-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta { font-size: 12.5px; color: var(--label-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-meta .sep { color: var(--label-4); }
.post-counts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

.empty { text-align: center; padding: 70px 20px; color: var(--label-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .glyph { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--fill); color: var(--label-3); margin-bottom: 6px; }
.empty h3 { margin: 0; color: var(--label); font-size: 19px; font-weight: 650; }
.empty p { margin: 0 0 8px; max-width: 420px; }

/* ---------------------------------------------------------------- sheet (modal) */

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 20px; overflow-y: auto; animation: backdrop-in 0.25s ease; }
.sheet { width: 100%; max-width: 780px; background: var(--bg-elevated); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: sheet-in 0.42s var(--ease); overflow: hidden; }
.sheet.sm { max-width: 520px; }
.sheet-header { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 16px; }
.sheet-header h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.024em; line-height: 1.2; }
.sheet-header .meta { margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--label-3); font-size: 13px; }
.sheet-body { padding: 4px 22px 22px; }
.sheet-footer { display: flex; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--separator); background: var(--surface-2); align-items: center; flex-wrap: wrap; }
.sheet .group { box-shadow: none; background: var(--surface-2); border-color: var(--separator); }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } }

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.gallery-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 6px; }
.gallery-strip a, .gallery-strip .f { flex: none; width: 112px; height: 112px; border-radius: 12px; overflow: hidden; background: var(--fill); display: grid; place-items: center; font-size: 11px; color: var(--label-3); text-align: center; padding: 0; }
.gallery-strip img { width: 100%; height: 100%; object-fit: cover; }

.kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.kv .v { overflow-wrap: anywhere; font-size: 13.5px; }
.kv .v a { overflow-wrap: anywhere; }
.kv .s { font-size: 12px; color: var(--label-3); }
.item-new { color: var(--accent-text); font-size: 11px; font-weight: 700; margin-left: 6px; }

.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; padding: 9px 0; position: relative; }
.tl .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--label-2); position: relative; z-index: 1; }
.tl .ic.published { background: var(--green-soft); color: var(--green); }
.tl .ic.update { background: var(--accent-soft); color: var(--accent-text); }
.tl .ic.uncertain, .tl .ic.failed { background: var(--orange-soft); color: var(--orange); }
.tl:not(:last-child)::after { content: ''; position: absolute; left: 13.5px; top: 37px; bottom: -9px; width: 1px; background: var(--separator); }
.tl .t { font-weight: 550; }
.tl .d { font-size: 12.5px; color: var(--label-3); }
.tl .when { font-size: 12px; color: var(--label-3); white-space: nowrap; }

/* ---------------------------------------------------------------- atividade */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.stat { padding: 18px 20px; }
.stat .k { font-size: 12.5px; color: var(--label-3); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--label-3); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.dist { display: flex; flex-direction: column; gap: 14px; }
.dist-row .top { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 6px; }
.dist-row .top .v { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--label-2); font-weight: 600; }
.bar { height: 6px; border-radius: 6px; background: var(--fill); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--label-3); }
.day { font-size: 13px; font-weight: 650; color: var(--label-2); margin: 22px 2px 8px; }
.day:first-child { margin-top: 0; }
.event { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; }
.event:hover { background: var(--fill); }
.event .th { width: 40px; height: 40px; border-radius: 9px; overflow: hidden; flex: none; background: var(--fill); display: grid; place-items: center; font-weight: 750; color: #fff; }
.event .th img { width: 100%; height: 100%; object-fit: cover; }
.event .body { flex: 1; min-width: 0; }
.event .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event .d { font-size: 12.5px; color: var(--label-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.event .when { font-size: 12px; color: var(--label-3); }

/* ---------------------------------------------------------------- ajustes */

.tpl-row { display: grid; grid-template-columns: 1fr 140px 110px auto; gap: 8px; align-items: center; padding: 10px 14px; }
.tpl-row + .tpl-row { border-top: 1px solid var(--separator); }
.tpl-row .input, .tpl-row .select { min-height: 32px; padding: 6px 10px; font-size: 13px; }
.tpl-row .input { font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.import-log { font-size: 12.5px; color: var(--label-3); display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; padding: 0 16px 14px; }
.import-log .ok { color: var(--green); }
.secret-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--fill); border-radius: var(--r); font-family: var(--mono); font-size: 16px; letter-spacing: 0.04em; justify-content: space-between; }

/* ---------------------------------------------------------------- login */

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(1200px 600px at 20% -10%, rgba(0, 113, 227, 0.08), transparent 60%),
  radial-gradient(900px 500px at 100% 110%, rgba(175, 82, 222, 0.08), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 380px; text-align: center; animation: fade-in 0.5s var(--ease); }
.auth-card .app-icon { margin: 0 auto 18px; }
.auth-card h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.026em; }
.auth-card .sub { color: var(--label-3); margin: 6px 0 26px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.auth-form .input { min-height: 44px; font-size: 15px; border-radius: 12px; }
.auth-form .btn { min-height: 44px; font-size: 15px; margin-top: 4px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--label-4); font-size: 12px; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--separator); }
.form-error { color: var(--red); font-size: 13px; text-align: center; min-height: 18px; }
.google-slot { display: flex; justify-content: center; min-height: 44px; }

/* ---------------------------------------------------------------- toasts */

.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 980px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow-lg); border: 1px solid var(--card-border); font-weight: 550; font-size: 13.5px; animation: toast-in 0.45s var(--ease); max-width: min(560px, 92vw);
}
.toast .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; flex: none; }
.toast.err .ic { background: var(--red); }
.toast.warn .ic { background: var(--orange); }
.toast a { font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(0.96); } }

/* ---------------------------------------------------------------- responsivo */

@media (max-width: 1180px) {
  .composer { grid-template-columns: 1fr; }
  .composer-preview { position: static; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--separator); overflow-x: auto; }
  .sidebar .brand-text, .sidebar .nav-title, .sidebar .nav.platforms, .sidebar-footer .bot-pill .who { display: none; }
  .sidebar .nav { flex-direction: row; }
  .sidebar .nav-item { width: auto; }
  .sidebar .nav-item .label, .sidebar .nav-item .count { display: none; }
  .sidebar-footer { margin: 0 0 0 auto; flex-direction: row; }
  .page { padding: 24px 16px 120px; }
  .large-title { font-size: 28px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .perf-grid { grid-template-columns: 1fr auto; }
  .tpl-row { grid-template-columns: 1fr 1fr; }
  .search { max-width: none; }
}
