/* LinkChat visual system — tokens, chrome, chats, páginas extras */
:root, [data-theme="dark"] {
  --bg: #07070b;
  --bg-glow-a: rgba(124, 58, 237, 0.28);
  --bg-glow-b: rgba(255, 255, 255, 0.06);
  --surface: #0c0c12;
  --surface-2: #14141c;
  --surface-3: #22222e;
  --border: #2e2e3d;
  --text: #ffffff;
  --muted: #a1a1b5;
  --accent: #7c3aed;
  --accent-soft: rgba(124, 58, 237, 0.16);
  --bubble-mine: #7c3aed;
  --bubble-mine-text: #ffffff;
  --bubble-theirs: #14141c;
  --bubble-theirs-text: #ffffff;
  --bubble-system: rgba(255, 255, 255, 0.95);
  --bubble-system-text: #07070b;
  --backdrop: rgba(0, 0, 0, 0.55);
  --scrollbar: #2e2e3d;
  --panel-shadow: 0 18px 40px -24px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.05);
  --empty-tile-a: rgba(124, 58, 237, 0.4);
  --empty-tile-b: rgba(255, 255, 255, 0.2);
  --toast-bg: #14141c;
  --input-placeholder: rgba(161, 161, 181, 0.8);
  --preview-a: #14141c;
  --preview-b: #0c0c12;
  --danger: #f87171;
  --success: #34d399;
}

[data-theme="light"] {
  --bg: #f4f1fb;
  --bg-glow-a: rgba(124, 58, 237, 0.14);
  --bg-glow-b: rgba(255, 255, 255, 0.9);
  --surface: #ffffff;
  --surface-2: #f0ebf8;
  --surface-3: #e4dcf2;
  --border: #d8d0e8;
  --text: #160f24;
  --muted: #6d6580;
  --accent: #7c3aed;
  --accent-soft: rgba(124, 58, 237, 0.12);
  --bubble-mine: #7c3aed;
  --bubble-mine-text: #ffffff;
  --bubble-theirs: #efeaf8;
  --bubble-theirs-text: #160f24;
  --bubble-system: #efeaf8;
  --bubble-system-text: #3b0764;
  --backdrop: rgba(22, 15, 36, 0.28);
  --scrollbar: #cfc6e0;
  --panel-shadow: 0 18px 40px -24px rgba(60, 30, 120, .28), inset 0 1px 0 rgba(255,255,255,.8);
  --empty-tile-a: rgba(124, 58, 237, 0.22);
  --empty-tile-b: rgba(22, 15, 36, 0.08);
  --toast-bg: #ffffff;
  --input-placeholder: rgba(109, 101, 128, 0.85);
  --preview-a: #efeaf8;
  --preview-b: #ffffff;
}

html, body { height: 100%; }
body.container-main,
body {
  color: var(--text);
  background:
    radial-gradient(900px 520px at 12% -12%, var(--bg-glow-a), transparent 55%),
    radial-gradient(720px 420px at 100% 0%, var(--bg-glow-b), transparent 48%),
    var(--bg);
  transition: background .25s ease, color .25s ease;
  font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body.lc-home { overflow: hidden; }
body.lc-auth { overflow-x: hidden; overflow-y: auto; min-height: 100%; }

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="light"] .grain { opacity: 0.02; }

#app_chatlink_cl_popup {
  position: relative;
  z-index: 1;
  height: 100%;
}

.ui-surface { background: var(--surface); border-color: var(--border); color: var(--text); }
.ui-surface-2 { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.ui-muted { color: var(--muted); }
.ui-text { color: var(--text); }
.ui-border { border-color: var(--border); }
.ui-accent { color: var(--accent); }
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  border-radius: .75rem;
  padding: .5rem .95rem;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
a.ui-btn {
  color: var(--text) !important;
  text-decoration: none !important;
}
.ui-btn:hover,
a.ui-btn:hover {
  border-color: var(--accent);
  background: var(--surface-3);
  color: var(--text) !important;
  text-decoration: none !important;
}
.ui-btn[data-active="true"] { border-color: var(--accent); }
.ui-btn:disabled { opacity: .4; cursor: not-allowed; }
.ui-input::placeholder { color: var(--input-placeholder); }
.ui-empty { background: color-mix(in srgb, var(--surface) 60%, transparent); border-color: var(--border); }
.ui-drawer {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--panel-shadow);
  color: var(--text);
}
.ui-toast {
  background: var(--toast-bg);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--panel-shadow);
}
.ui-chat-panel {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--panel-shadow);
}
.ui-bubble-mine {
  background: var(--bubble-mine);
  color: var(--bubble-mine-text);
}
.ui-bubble-theirs {
  background: var(--bubble-theirs);
  color: var(--bubble-theirs-text);
  border: 1px solid var(--border);
}
.ui-bubble-system {
  background: var(--bubble-system);
  color: var(--bubble-system-text);
  border: 1px solid var(--border);
}
.ui-composer { background: var(--surface-2); }
.ui-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--panel-shadow);
  color: var(--text);
}
.tile-a { background: var(--empty-tile-a); }
.tile-b { background: var(--empty-tile-b); }
.backdrop-theme { background: var(--backdrop); }
.lc-kicker {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #7c3aed;
  margin: 0;
}
.lc-kicker-sm {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #7c3aed;
  margin: 0;
}

.app-shell {
  position: relative;
  z-index: 10;
  display: flex;
  height: 100%;
  min-height: 100%;
  flex-direction: column;
  padding: 1rem;
}
.lc-root.is-ext-full .app-shell,
.app-shell.is-ext-full {
  padding: 0;
}
.lc-root.is-ext-full .chat-grid {
  height: 100%;
  min-height: 0;
  flex: 1;
}
.lc-root.is-ext-full .lc-chat-cell,
.lc-root.is-ext-full .lc-chat {
  height: 100%;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}
body.lc-ext { overflow: hidden; }
.app-shell.page-scroll {
  overflow-y: auto;
  overflow-x: hidden;
}
.lc-header {
  position: relative;
  z-index: 60;
  margin-bottom: .75rem;
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: .75rem;
}
@media (min-width: 1100px) {
  .lc-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.lc-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}
.brand-title {
  font-size: 1.45rem;
  line-height: 1;
  margin: 0;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header-actions .ui-btn {
  border-radius: .75rem;
  padding: .5rem .75rem;
  font-size: .875rem;
  font-weight: 500;
}
.open-form {
  display: flex;
  width: 100%;
  max-width: 48rem;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: box-shadow .2s ease;
}
.open-form input,
.open-form .ui-input {
  min-width: 0;
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: .75rem 1rem;
  font-size: 15px;
  outline: none;
  box-shadow: none !important;
}
.open-form button[type="submit"],
.lc-open-btn,
a.lc-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 0;
  border-radius: .75rem;
  background: #7c3aed;
  color: #fff !important;
  padding: .5rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none !important;
}
.open-form button[type="submit"] { margin: .25rem; }
.lc-open-btn:hover,
a.lc-open-btn:hover { background: #6d28d9; color: #fff !important; }
.key-field:focus-within { box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.22); }
.unread-pill {
  margin-left: .25rem;
  border-radius: 999px;
  background: #7c3aed;
  color: #fff;
  padding: .1rem .4rem;
  font-size: 10px;
  font-weight: 600;
}

.chat-grid {
  display: grid;
  gap: .7rem;
  min-height: 0;
  flex: 1;
}
@media (max-width: 767px) {
  .app-shell {
    height: 100%;
    overflow: hidden;
    padding: .75rem;
  }
  .chat-grid {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .5rem;
    gap: .75rem;
  }
  .chat-grid[data-count="0"] { display: block; overflow: hidden; }
  .chat-grid > .lc-chat-cell {
    flex: 0 0 auto;
    height: min(62vh, 460px);
    min-height: 320px;
  }
  .chat-grid[data-count="1"] > .lc-chat-cell {
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
  }
  .header-actions { gap: .4rem; }
  .header-actions .ui-btn {
    padding: .45rem .65rem;
    font-size: .75rem;
  }
  .brand-title { font-size: 1.75rem; }
  .open-form { max-width: none; }
  .lc-root.is-ext-full .app-shell,
  .lc-root.is-ext-full .app-shell.is-ext-full {
    padding: 0;
  }
  .lc-root.is-ext-full .chat-grid {
    overflow: hidden;
    padding-bottom: 0;
    gap: 0;
  }
  .lc-root.is-ext-full .chat-grid > .lc-chat-cell,
  .lc-root.is-ext-full .chat-grid[data-count="1"] > .lc-chat-cell {
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
  }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .chat-grid { height: 100%; }
  .chat-grid[data-count="0"] { display: block; }
  .chat-grid[data-count="1"] { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .chat-grid[data-count="2"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  .chat-grid[data-count="3"],
  .chat-grid[data-count="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
  .chat-grid[data-count="5"],
  .chat-grid[data-count="6"] { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); }
  .chat-grid[data-count="7"],
  .chat-grid[data-count="8"] { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 1fr); }
}
@media (min-width: 1100px) {
  .chat-grid { height: 100%; }
  .chat-grid[data-count="0"] { display: block; }
  .chat-grid[data-count="1"] { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .chat-grid[data-count="2"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  .chat-grid[data-count="3"] { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr; }
  .chat-grid[data-count="4"] { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr; }
  .chat-grid[data-count="5"],
  .chat-grid[data-count="6"] { grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; }
  .chat-grid[data-count="7"],
  .chat-grid[data-count="8"] { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 1fr; }
}

.empty-state {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 1.5rem;
  border: 1px dashed var(--border);
  padding: 1.25rem;
  text-align: center;
}
.empty-state h2 {
  font-size: 1.875rem;
  color: var(--text);
  margin: 0;
}
.lc-root.is-ext .empty-state.is-ext-empty {
  justify-content: flex-start;
  overflow-y: auto;
  padding: .75rem .7rem .85rem;
}
.lc-root.is-ext .empty-state.is-ext-empty h2 {
  font-size: 1.05rem;
}
.lc-root.is-ext .empty-state.is-ext-empty .recent-cards {
  margin-top: .7rem;
  max-width: 100%;
}
.lc-root.is-ext .empty-state.is-ext-empty .recent-card {
  width: 64px;
  min-height: 64px;
  padding: .35rem .25rem;
}
.empty-preview {
  margin-bottom: 1.25rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  opacity: .7;
  width: min(100%, 280px);
}
.empty-preview span {
  height: 2rem;
  border-radius: .375rem;
}
.empty-extras {
  width: min(100%, 920px);
  margin-top: 1.5rem;
  display: grid;
  gap: .75rem;
  text-align: left;
}
@media (min-width: 768px) {
  .empty-extras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.empty-extra-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  padding: .9rem 1rem;
  max-height: 220px;
  overflow: auto;
}
.empty-extra-card h3 {
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7c3aed;
  margin: 0 0 .6rem;
}
.empty-link-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: .4rem .2rem;
  text-align: left;
  cursor: pointer;
  border-radius: .6rem;
}
.empty-link-row:hover { background: var(--surface-2); }

.lc-chat-cell {
  min-width: 0;
  min-height: 0;
  height: 100%;
}
.lc-chat-cell > .custom-spacing,
.lc-chat-cell > .h-100 {
  height: 100%;
}

.panel-enter { animation: panelIn .28s ease both; }
.msg-enter { animation: msgIn .22s ease both; }
.toast-enter { animation: toastIn .25s ease both; }
.pulse-ring { animation: pulseRing .7s ease; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .5); }
  100% { box-shadow: 0 0 0 12px rgba(124, 58, 237, 0); }
}

.messages::-webkit-scrollbar,
.drawer-list::-webkit-scrollbar,
.empty-extra-card::-webkit-scrollbar { width: 8px; }
.messages::-webkit-scrollbar-thumb,
.drawer-list::-webkit-scrollbar-thumb,
.empty-extra-card::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 99px;
}

.history-item {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: .75rem;
  border: 0;
  background: transparent;
  border-radius: 1rem;
  padding: .65rem .75rem;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.history-item[data-open="true"] {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.history-item:hover { background: var(--surface-2); }

.lc-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.drawer {
  position: fixed;
  top: .75rem;
  bottom: .75rem;
  left: .75rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  width: min(340px, calc(100vw - 2rem));
  transform: translateX(-110%);
  transition: transform .28s ease, width .28s ease, background .25s ease, border-color .25s ease;
}
.drawer[data-open="true"] { transform: translateX(0); }
.drawer[data-wide="true"] { width: min(520px, calc(100vw - 2rem)); }
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.backdrop[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 767px) {
  .drawer {
    left: .5rem;
    right: .5rem;
    top: .5rem;
    bottom: .5rem;
    width: auto;
    max-width: none;
  }
  .drawer[data-wide="true"] { width: auto; }
  .drawer-expand-btn { display: none; }
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}
.drawer-header .d-flex {
  gap: .45rem;
  flex-shrink: 0;
}
.drawer-expand-btn {
  height: auto;
  width: auto;
  padding: .35rem .7rem;
  font-size: 12px;
  font-weight: 600;
  border-radius: .65rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.drawer-icon-btn {
  display: grid;
  place-items: center;
  height: 2rem;
  width: 2rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.drawer-icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}
.drawer-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: .5rem;
}
.drawer-footer {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  border-top: 1px solid var(--border);
  padding: .75rem;
}
.drawer-footer a,
.drawer-footer button {
  border-radius: .7rem;
  padding: .4rem .65rem;
  font-size: .75rem;
}

/* Chat panel */
.lc-chat {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--panel-shadow);
  position: relative;
}
.lc-chat-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid var(--border);
  padding: .6rem .75rem;
}
.lc-chat-head h2 {
  margin: 0;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lc-chat-head h2.is-editable {
  cursor: pointer;
}
.lc-chat-head h2.is-editable:hover {
  color: var(--accent);
}
.lc-rename-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: .5rem;
  padding: .15rem .45rem;
  font-size: .875rem;
  font-weight: 600;
  outline: none;
}
.lc-chat-messages {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: .75rem;
}
.lc-chat-composer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: .5rem;
}
.lc-composer-inner {
  display: flex;
  align-items: center;
  gap: .5rem;
  border-radius: .75rem;
  padding: .35rem .5rem;
  background: var(--surface-2);
}
.lc-composer-inner input,
.lc-composer-inner .form-control {
  min-width: 0;
  flex: 1;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--text) !important;
  font-size: 13px;
  padding: .25rem;
}
.lc-send {
  display: grid;
  place-items: center;
  height: 2rem;
  width: 2rem;
  border: 0;
  border-radius: .5rem;
  background: #7c3aed;
  color: #fff;
  cursor: pointer;
}
.lc-send:hover { background: #6d28d9; color: #fff; }
.lc-msg-row { display: flex; margin-bottom: .5rem; }
.lc-msg-row.is-mine { justify-content: flex-end; }
.lc-msg-row.is-theirs { justify-content: flex-start; }
.lc-bubble {
  max-width: 88%;
  border-radius: 1rem;
  padding: .5rem .75rem;
  font-size: 13px;
  line-height: 1.45;
}
.lc-msg-row.is-mine .lc-bubble { border-bottom-right-radius: .35rem; }
.lc-msg-row.is-theirs .lc-bubble { border-bottom-left-radius: .35rem; }
.lc-stamp { margin-top: .25rem; font-size: 10px; opacity: .6; }
.m-title {
  background: transparent !important;
  padding: 0 !important;
  color: inherit !important;
  font-size: 11px !important;
}
.lc-msg-name {
  display: inline-block;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.25;
  cursor: pointer;
  border-radius: .35rem;
  outline: none;
}
.lc-msg-name:hover,
.lc-msg-name:focus {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.popover.lc-user-pop {
  max-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  box-shadow: var(--panel-shadow);
  color: var(--text);
}
.popover.lc-user-pop .popover-header {
  display: none;
}
.popover.lc-user-pop .popover-body {
  padding: 0;
  color: var(--text);
}
.popover.lc-user-pop.bs-popover-right .arrow::before,
.popover.lc-user-pop.bs-popover-auto[x-placement^="right"] .arrow::before { border-right-color: var(--border); }
.popover.lc-user-pop.bs-popover-right .arrow::after,
.popover.lc-user-pop.bs-popover-auto[x-placement^="right"] .arrow::after { border-right-color: var(--surface); }
.popover.lc-user-pop.bs-popover-left .arrow::before,
.popover.lc-user-pop.bs-popover-auto[x-placement^="left"] .arrow::before { border-left-color: var(--border); }
.popover.lc-user-pop.bs-popover-left .arrow::after,
.popover.lc-user-pop.bs-popover-auto[x-placement^="left"] .arrow::after { border-left-color: var(--surface); }
.popover.lc-user-pop.bs-popover-top .arrow::before,
.popover.lc-user-pop.bs-popover-auto[x-placement^="top"] .arrow::before { border-top-color: var(--border); }
.popover.lc-user-pop.bs-popover-top .arrow::after,
.popover.lc-user-pop.bs-popover-auto[x-placement^="top"] .arrow::after { border-top-color: var(--surface); }
.popover.lc-user-pop.bs-popover-bottom .arrow::before,
.popover.lc-user-pop.bs-popover-auto[x-placement^="bottom"] .arrow::before { border-bottom-color: var(--border); }
.popover.lc-user-pop.bs-popover-bottom .arrow::after,
.popover.lc-user-pop.bs-popover-auto[x-placement^="bottom"] .arrow::after { border-bottom-color: var(--surface); }

.lc-user-card { padding: .95rem; min-width: 196px; }
.lc-user-card-head {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .85rem;
}
.lc-user-card-avatar {
  width: 40px;
  height: 40px;
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.lc-user-card-meta strong {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  word-break: break-word;
}
.lc-user-card-actions {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.lc-user-card-btn {
  width: 100%;
  font-size: .8rem;
  padding: .48rem .7rem;
}
.ui-btn.is-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-2));
}
.ui-btn.is-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}
.m-text {
  color: inherit !important;
  padding: 0 !important;
}

/* Login / páginas */
.page-shell {
  position: relative;
  z-index: 10;
  margin: 0 auto;
  display: flex;
  width: 100%;
  max-width: 72rem;
  flex-direction: column;
  padding: 1.25rem 1rem 2.5rem;
}
.page-header {
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.page-header .brand-title {
  white-space: nowrap;
}
.login-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
}
@media (min-width: 960px) {
  .login-grid {
    grid-template-columns: .92fr 1.08fr;
    gap: 2rem;
    align-items: stretch;
  }
}
.field {
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: box-shadow .2s ease;
}
.field:focus-within { box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.22); }
.field input,
.field select,
.field textarea,
.field .form-control {
  width: 100%;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--text) !important;
  padding: .75rem 1rem;
  font-size: 15px;
  outline: none;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.field-area textarea {
  resize: vertical;
  min-height: 110px;
  display: block;
}
.lc-submit {
  width: 100%;
  border: 0;
  border-radius: 1rem;
  background: #7c3aed;
  color: #fff;
  padding: .75rem 1rem;
  font-size: .875rem;
  font-weight: 600;
}
.lc-submit:hover { background: #6d28d9; color: #fff; }
.preview-panel {
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: var(--preview-b);
  box-shadow: var(--panel-shadow);
  padding: 1.25rem;
}
.plan-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: .85rem;
  color: var(--text);
  position: relative;
  height: 100%;
}
.plan-card[data-popular="true"],
.plan-card.popular {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.plan-card h3,
.plan-card .price,
.plan-card .welcome-title { color: var(--text); }
.plan-card p,
.plan-card .plan-features,
.plan-card .period { color: var(--muted); }
.btn-plan,
.cta-button,
.btn-save-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  border: 0;
  border-radius: .85rem;
  background: #7c3aed !important;
  color: #fff !important;
  padding: .65rem 1rem;
  font-weight: 600;
}
.btn-plan:hover,
.cta-button:hover,
.btn-save-all:hover { background: #6d28d9 !important; color: #fff !important; }
.fade-up { animation: fadeUp .45s ease both; }
.fade-up-delay { animation: fadeUp .55s ease .08s both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.page-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) {
  .page-grid-2 { grid-template-columns: 1fr 1fr; }
  .page-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .page-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.lc-table {
  width: 100%;
  color: var(--text);
  background: transparent;
}
.lc-table th,
.lc-table td {
  border-color: var(--border) !important;
  background: transparent !important;
  color: var(--text);
  vertical-align: middle;
}
.lc-table thead th { color: var(--muted); font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }

/* Bootstrap / páginas legadas no mesmo visual */
.navbar-standard,
.navbar-custom,
.navbar.extension,
.navbar.bg-dark,
.b-sidebar-header {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: none !important;
  color: var(--text) !important;
}
.navbar-brand,
.navbar-brand-standard,
.nav-link-standard,
.nav-link-custom,
.navbar-dark .navbar-nav .nav-link {
  color: var(--text) !important;
}
.card, .form-card, .info-card, .chart-card, .feature-card, .dashboard-container .info-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  box-shadow: var(--panel-shadow) !important;
}
.welcome-title, .welcome-text, .card-title, .card-subtitle, .card-value, .description-text p {
  color: var(--text) !important;
}
.welcome-text, .card-subtitle, .card-text { color: var(--muted) !important; }
.hero-section, .features-section, .pricing-section, .main-container, .dashboard-container {
  background: transparent !important;
}
.modal-content {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 1.5rem !important;
  box-shadow: var(--panel-shadow);
}
.modal-header, .modal-footer {
  border-color: var(--border) !important;
}
.modal-title { color: var(--text) !important; }
.modal-backdrop { background: var(--backdrop); }
.lc-modal .modal-dialog { max-width: 28rem; margin: 1.25rem auto; }
.lc-modal-sheet {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 1.5rem !important;
  overflow: hidden;
}
.lc-modal-inner { padding: 1.15rem 1.2rem 1.2rem; }
.lc-modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1.15rem;
}
.lc-modal-top h3 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
}
.lc-modal-fields label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  margin-bottom: .35rem;
  color: var(--text);
}
.lc-price-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1rem;
  border-radius: 1rem;
  border: 1px dashed var(--border);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}
.lc-price-box strong { font-size: 1.25rem; }
.lc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1.15rem;
}
.form-control, .custom-select, .form-control:disabled {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.form-control:focus, .custom-select:focus {
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.22) !important;
  border-color: var(--accent) !important;
}
label, .form-label { color: var(--text); }
.btn-primary, .badge-primary, .badge-pill.badge-primary {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
}
.btn-secondary {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.table, .table td, .table th, .table thead th { color: var(--text); border-color: var(--border) !important; }
.table-striped tbody tr:nth-of-type(odd) { background: var(--surface-2) !important; }
.alert-info, .alert-danger, .alert-success, .alert-warning {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.profile-container, .profile-field label, .field-value {
  background: transparent;
  color: var(--text);
}
.profile-field label { color: var(--muted); }
.text-muted, .text-dark { color: var(--muted) !important; }
a { color: #7c3aed; }
a:hover { color: #6d28d9; }
.swal2-popup {
  background: var(--surface) !important;
  color: var(--text) !important;
}
.password-toggle-login, .password-toggle { color: var(--muted); }
.password-toggle-login:hover, .password-toggle:hover { color: var(--accent); }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
*::-webkit-scrollbar { width: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 99px;
  border: 0;
}

.company-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.company-empty .ui-card {
  max-width: 520px;
  padding: 1.5rem;
  border-radius: 1.25rem;
  text-align: center;
}

.online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  height: .65rem;
  width: .65rem;
  border-radius: 999px;
  border: 2px solid var(--surface);
}
.online-dot.is-on { background: #b794f6; }
.online-dot.is-off { background: var(--muted); }
.rounded-xl { border-radius: .75rem !important; }
.rounded-3xl { border-radius: 1.5rem !important; }
.chart-card h3, .chart-header h3, .donation-section h4 { color: var(--text); }
.donation-section p { color: var(--muted); }
.lc-avatar { width: 36px; height: 36px; }
.container.mt-5,
.container.mt-1,
.page-shell .container {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.lc-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.lc-brand:hover { text-decoration: none; color: inherit; }
.lc-brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: .65rem;
}
.brand-title {
  font-size: 1.45rem;
  line-height: 1;
  margin: 0;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.brand-link { color: var(--text); }
.brand-chat { color: #7c3aed; }

.ui-icon-btn {
  width: 38px;
  height: 38px;
  padding: 0 !important;
  border-radius: 999px !important;
  display: grid;
  place-items: center;
  font-size: 1rem;
}
.open-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  max-width: 52rem;
}
.open-row .open-form {
  flex: 1;
  max-width: none;
}
.lc-profile-orb {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.lc-profile-orb:hover {
  border-color: var(--accent);
  transform: scale(1.04);
}

.recent-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  max-width: 420px;
  margin: 1.35rem auto 0;
}
.recent-card {
  width: 74px;
  min-height: 74px;
  border-radius: .9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: .45rem .3rem;
  cursor: pointer;
  box-shadow: var(--panel-shadow);
}
.recent-card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.recent-card img {
  width: 16px;
  height: 16px;
}
.recent-card span {
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-hero {
  position: relative;
  overflow: hidden;
  border-radius: 2rem;
  padding: 2.4rem 1.4rem 2rem;
  border: 1px solid var(--border);
  background:
    radial-gradient(420px 220px at 8% -20%, var(--bg-glow-a), transparent 60%),
    radial-gradient(380px 180px at 92% 120%, var(--accent-soft), transparent 55%),
    var(--surface);
  box-shadow: var(--panel-shadow);
}
.users-hero h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -.03em;
  max-width: 18ch;
  text-transform: none;
}
.users-copy {
  max-width: 40rem;
  font-size: .95rem;
  line-height: 1.75;
}
.users-copy p + p { margin-top: .85rem; }
.feature-soft {
  border-radius: 1.5rem;
  padding: 1.25rem 1.15rem;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--border);
  height: 100%;
  transition: transform .2s ease, border-color .2s ease;
}
.feature-soft:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}
.feature-soft h3 {
  font-size: 1.15rem;
  font-weight: 700;
}
.plans-fluid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 760px) {
  .plans-fluid {
    grid-template-columns: .9fr 1.2fr;
    align-items: stretch;
  }
}
.plan-featured {
  border-radius: 1.6rem;
  padding: 1.4rem;
}

.pay-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 0 2rem;
}
.pay-stage-list {
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  max-width: 64rem;
  width: 100%;
  margin: 0 auto;
}
.pay-list-card {
  width: 100%;
  border-radius: 1.5rem;
  padding: 1.15rem 1.15rem 1.25rem;
  overflow: hidden;
}
.pay-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.pay-row {
  width: min(100%, 34rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  padding: .95rem 1.1rem;
  border: 1px dashed var(--border);
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  margin-bottom: .65rem;
}
.pay-row .ui-btn,
.pay-row .lc-open-btn {
  flex-shrink: 0;
  width: auto;
  padding: .45rem .9rem;
}

.users-landing {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 0 2rem;
}
.users-hero-split {
  display: grid;
  gap: 2rem;
  align-items: center;
  min-height: min(78vh, 720px);
  margin-bottom: 2.5rem;
}
@media (min-width: 960px) {
  .users-hero-split {
    grid-template-columns: 1.05fr .95fr;
    gap: 2.5rem;
  }
}
.users-hero-title {
  font-size: clamp(2.15rem, 5.4vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -.04em;
  font-weight: 800;
  color: var(--text);
  margin: .85rem 0 1.1rem;
  max-width: 14ch;
}
.users-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1.4rem;
}
.users-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 1.75rem;
}
.users-stats strong {
  display: block;
  font-size: 1.35rem;
  color: var(--text);
  line-height: 1;
}
.users-stats span {
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.users-hero-visual {
  position: relative;
  min-height: 420px;
}
.users-hero-visual .shot {
  position: absolute;
  object-fit: cover;
  border-radius: 1.6rem;
  border: 1px solid var(--border);
  box-shadow: 0 28px 60px -28px rgba(0,0,0,.7);
  background: var(--surface-2);
}
.shot-main {
  width: 78%;
  height: 340px;
  left: 0;
  top: 36px;
  z-index: 2;
}
.shot-side {
  width: 38%;
  height: 280px;
  right: 0;
  top: 0;
  z-index: 3;
  object-position: center;
  transform: rotate(4deg);
}
.shot-float {
  width: 46%;
  height: 170px;
  right: 8%;
  bottom: 8px;
  z-index: 4;
  animation: usersFloat 4.8s ease-in-out infinite;
}
@keyframes usersFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.users-mosaic {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 110px;
  gap: .7rem;
  margin: 0 0 3rem;
}
.users-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1.15rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.users-mosaic img:nth-child(1) { grid-column: span 4; grid-row: span 2; }
.users-mosaic img:nth-child(n+2) { grid-column: span 2; grid-row: span 2; }
.users-section { margin-bottom: 3rem; }
.users-feature-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 800px) {
  .users-feature-grid { grid-template-columns: repeat(3, 1fr); }
}
.users-feature-card {
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--panel-shadow);
}
.users-feature-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}
.users-feature-card > div { padding: 1.1rem 1.15rem 1.25rem; }
.users-split {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 3rem;
}
@media (min-width: 860px) {
  .users-split { grid-template-columns: 1fr 1.15fr; }
}
.users-split-img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  max-height: 420px;
  object-fit: cover;
  object-position: center;
  border-radius: 1.6rem;
  border: 1px solid var(--border);
  box-shadow: var(--panel-shadow);
  background: var(--surface-2);
  display: block;
}
.users-steps {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
}
.users-steps li {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--text);
  margin-bottom: .7rem;
  font-weight: 600;
}
.users-steps span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: .8rem;
  flex-shrink: 0;
}
.users-finale {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  padding: 1.2rem;
  border-radius: 1.8rem;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--panel-shadow);
}
@media (min-width: 760px) {
  .users-finale { grid-template-columns: .9fr 1.1fr; padding: 1.4rem; }
}
.users-finale img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 1.2rem;
}
@media (max-width: 759px) {
  .users-hero-visual { min-height: 340px; }
  .shot-main { height: 250px; }
  .shot-side { height: 210px; }
  .users-mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 140px;
  }
  .users-mosaic img:nth-child(1) { grid-column: span 2; }
  .users-mosaic img:nth-child(n+2) { grid-column: span 1; grid-row: span 1; }
}
