/* MarkSpace look: black canvas, lime accent, Anton display + Inter text. Mobile first. */
:root {
  --bg: #000;
  --surface: #0d0d0d;
  --surface-2: #151515;
  --surface-3: #1e1e1e;
  --line: #262626;
  --line-2: #333;
  --text: #f4f4f2;
  --muted: #9a9a96;
  --dim: #6b6b68;
  --lime: #d4f542;
  --lime-2: #e3fa7a;
  --lime-ink: #0b0b0b;
  --danger: #ff6b5e;
  --warn: #f5c542;
  --ok: #7ee08a;
  --radius: 14px;
  --radius-s: 10px;
  --display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; margin: 0; line-height: 1.05; }
h1 { font-size: clamp(30px, 7vw, 44px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 .6em; }
a { color: var(--lime); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--lime); color: var(--lime-ink); padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.lime { color: var(--lime); }

/* boot */
.boot { min-height: 100vh; display: grid; place-items: center; grid-auto-flow: column; gap: 6px; }
.logo-word { font-family: var(--display); font-size: 30px; letter-spacing: .04em; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); display: inline-block; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.btn.primary:hover { background: var(--lime-2); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: var(--radius-s); border: 1px solid var(--line-2); background: var(--surface); outline: none; }
.input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(212, 245, 66, .15); }
.input[disabled] { opacity: .5; }
.phone { display: flex; gap: 8px; }
.phone .ddi { flex: 0 0 auto; display: grid; place-items: center; padding: 0 14px; border-radius: var(--radius-s); border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); border: 1px solid var(--line-2); }
.badge.lime { background: rgba(212, 245, 66, .12); color: var(--lime); border-color: rgba(212, 245, 66, .35); }
.badge.danger { color: var(--danger); border-color: rgba(255, 107, 94, .4); }
.badge.ok { color: var(--ok); border-color: rgba(126, 224, 138, .4); }
.chip { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); margin: 0 6px 6px 0; font-size: 13px; }
.error-text { color: var(--danger); font-size: 14px; min-height: 1.4em; }

/* login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-hero { display: none; }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; padding: 40px 22px; align-self: center; }
.brandline { display: flex; align-items: baseline; gap: 2px; margin-bottom: 6px; }
.brandline .logo-word { font-size: 38px; }
.brandline .ia { font-family: var(--display); font-size: 38px; color: var(--lime); }
.tagline { color: var(--muted); margin-bottom: 30px; }
.auth h1 { margin-bottom: 6px; }
.auth .switch { color: var(--muted); margin-bottom: 26px; }
.auth .switch button { background: none; border: 0; color: var(--lime); cursor: pointer; padding: 0; font-weight: 600; text-decoration: underline; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.soon { font-size: 11px; font-weight: 700; color: var(--lime-ink); background: var(--lime); border-radius: 999px; padding: 2px 8px; }
@media (min-width: 900px) {
  .auth { grid-template-columns: 1.1fr 1fr; }
  .auth-hero { display: flex; flex-direction: column; justify-content: flex-end; padding: 56px; background:
    radial-gradient(circle at 20% 15%, rgba(212, 245, 66, .22), transparent 45%), radial-gradient(circle at 85% 80%, rgba(212, 245, 66, .08), transparent 40%), var(--surface); border-right: 1px solid var(--line); }
  .auth-hero .big { font-family: var(--display); font-size: 84px; line-height: .95; text-transform: uppercase; }
  .auth-hero .big em { color: var(--lime); font-style: normal; }
}

/* shell */
.shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(0, 0, 0, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .logo { display: flex; align-items: baseline; text-decoration: none; color: var(--text); }
.topbar .logo .logo-word { font-size: 24px; }
.topbar .logo .ia { font-family: var(--display); font-size: 24px; color: var(--lime); }
.topbar .spacer { flex: 1; }
.org-switch { max-width: 46vw; min-height: 38px; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); }
.credits-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 38px; border-radius: 999px; background: rgba(212, 245, 66, .1); border: 1px solid rgba(212, 245, 66, .35); color: var(--lime); font-weight: 700; text-decoration: none; font-size: 13px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: transparent; border: 1px solid var(--line-2); cursor: pointer; color: var(--text); }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; overflow-x: auto; background: #050505; border-top: 1px solid var(--line); scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: 1 0 auto; min-width: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 0 6px; }
.nav a svg { width: 22px; height: 22px; }
.nav a[aria-current="page"] { color: var(--lime); }
.main { padding: 18px 14px calc(var(--nav-h) + 28px); width: 100%; max-width: 1280px; margin: 0 auto; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head .kicker { color: var(--lime); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 6px; }
.tabs { display: flex; gap: 6px; margin: -4px 0 18px; overflow-x: auto; }
.tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tabs a[aria-current="page"] { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
@media (min-width: 960px) {
  .shell { grid-template-columns: 232px 1fr; grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; padding: 12px 22px; }
  .nav { position: sticky; top: 63px; height: calc(100vh - 63px); flex-direction: column; overflow: visible; border-top: 0; border-right: 1px solid var(--line); padding: 16px 12px; gap: 4px; background: var(--bg); }
  .nav a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 14px; padding: 11px 14px; border-radius: 12px; }
  .nav a:hover { background: var(--surface-2); color: var(--text); }
  .nav a[aria-current="page"] { background: rgba(212, 245, 66, .1); }
  .main { padding: 28px 32px 48px; }
}

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }
.card h2, .card h3 { margin-bottom: 12px; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.empty { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 30px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 8px; }
.skeleton { height: 64px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* conversations */
.chat { display: grid; grid-template-columns: 1fr; gap: 0; height: calc(100vh - 63px - var(--nav-h) - 36px); min-height: 420px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.chat-list { overflow-y: auto; border-right: 1px solid var(--line); }
.chat-list .search { position: sticky; top: 0; padding: 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
.conv { width: 100%; display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; padding: 12px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; color: var(--text); }
.conv:hover { background: var(--surface-2); }
.conv[aria-current="true"] { background: var(--surface-3); box-shadow: inset 3px 0 0 var(--lime); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--lime); font-family: var(--display); font-size: 17px; }
.conv .mid { display: grid; min-width: 0; }
.conv .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .last { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .meta { font-size: 11px; color: var(--dim); text-align: right; }
.unread { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--lime); color: var(--lime-ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.thread { display: none; grid-template-rows: auto 1fr auto; min-height: 0; }
.chat.has-thread .chat-list { display: none; }
.chat.has-thread .thread { display: grid; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.thread-head .who { flex: 1; min-width: 0; }
.thread-head .who strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head .who small { color: var(--dim); }
.msgs { overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 6px; background: radial-gradient(circle at 50% 0, rgba(212, 245, 66, .04), transparent 60%), #070707; }
.msg { max-width: 86%; padding: 9px 12px 6px; border-radius: 16px; background: var(--surface-3); align-self: flex-start; word-wrap: break-word; white-space: pre-wrap; }
.msg.out { align-self: flex-end; background: #1f2a07; border: 1px solid rgba(212, 245, 66, .25); }
.msg .time { display: block; font-size: 10px; color: var(--dim); text-align: right; margin-top: 2px; }
.msg .time .st-failed { color: var(--danger); }
.msg img, .msg video { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin-bottom: 6px; background: #000; }
.msg audio { max-width: 240px; }
.msg .doc { display: inline-flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); margin-bottom: 6px; color: var(--text); text-decoration: none; }
.msg .tpl { font-size: 11px; color: var(--lime); text-transform: uppercase; letter-spacing: .08em; display: block; margin-bottom: 2px; }
.day-sep { align-self: center; font-size: 11px; color: var(--dim); padding: 3px 10px; border-radius: 999px; background: var(--surface-2); margin: 8px 0; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--surface); align-items: flex-end; }
.composer textarea { flex: 1; resize: none; max-height: 140px; min-height: 44px; border-radius: 22px; }
.ws-state { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); }
.ws-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.ws-state[data-state="open"]::before { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.ws-state[data-state="connecting"]::before { background: var(--warn); }
.back-btn { display: inline-grid; }
@media (min-width: 820px) {
  .chat { grid-template-columns: 320px 1fr; height: calc(100vh - 63px - 120px); }
  .chat .thread, .chat.has-thread .thread { display: grid; }
  .chat.has-thread .chat-list { display: block; }
  .back-btn { display: none; }
  .thread-empty { display: grid; place-items: center; color: var(--muted); }
}
@media (min-width: 960px) { .chat { height: calc(100vh - 63px - 140px); } }

/* brand */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.swatch { border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.swatch .color { height: 84px; }
.swatch .info { padding: 8px 10px; }
.swatch .hex { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.swatch .role { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.font-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.font-row:last-child { border-bottom: 0; }
.font-row .sample { font-size: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.axis { display: grid; grid-template-columns: 1fr; gap: 4px; margin-bottom: 14px; }
.axis .ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--lime); }
.persona { display: grid; gap: 6px; }
.persona dt { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.persona dd { margin: 0 0 6px; }
.logo-box { display: grid; place-items: center; min-height: 140px; border-radius: var(--radius-s); background: #fff; padding: 16px; }
.logo-box img { max-width: 100%; max-height: 120px; }
.logo-box.none { background: var(--surface-2); color: var(--dim); }
.positioning { font-size: 18px; line-height: 1.45; }

/* kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 82vw); gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; }
@media (min-width: 720px) { .board { grid-auto-columns: minmax(230px, 1fr); } }
@media (min-width: 1200px) { .board { grid-auto-columns: minmax(190px, 1fr); } }
.col { scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 320px; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.col-head h2 { font-size: 15px; }
.col-head .count { font-size: 12px; color: var(--dim); }
.col-body { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 8px; border-radius: 0 0 var(--radius) var(--radius); }
.col-body.drop { background: rgba(212, 245, 66, .06); outline: 2px dashed rgba(212, 245, 66, .5); outline-offset: -6px; }
.kcard { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 12px; cursor: grab; }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .4; }
.kcard .title { font-weight: 600; margin-bottom: 4px; }
.kcard .desc { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.kcard .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kcard select { min-height: 32px; padding: 4px 8px; font-size: 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-2); }
.col[data-status="publicado"] .col-head h2 { color: var(--lime); }

/* lists / tables */
.list { display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.item .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.item .actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 720px) { .item { grid-template-columns: 1fr auto; align-items: center; } }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.neg { color: var(--danger); }
td.pos { color: var(--ok); }

/* credits */
.balance { font-family: var(--display); font-size: clamp(64px, 18vw, 110px); line-height: 1; color: var(--lime); }
.plan { position: relative; background: linear-gradient(160deg, #1a2105, var(--surface) 55%); border-color: rgba(212, 245, 66, .35); }
.plan .price { font-family: var(--display); font-size: 46px; }
.plan .price small { font-family: var(--sans); font-size: 14px; color: var(--muted); }
.plan ul { padding-left: 18px; margin: 10px 0 16px; color: var(--muted); }
.cost-table td:last-child { text-align: right; color: var(--lime); font-weight: 600; }

/* toasts */
.toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 16px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); animation: rise .2s ease-out; }
.toast.error { border-color: rgba(255, 107, 94, .6); }
.toast.ok { border-color: rgba(212, 245, 66, .6); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
@media (min-width: 960px) { .toasts { bottom: 24px; left: auto; right: 24px; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* spacing between stacked blocks inside a page (grids and cards) */
.grid > .card + .card { margin-top: 0; }
.grid + .card, .card + .grid, .grid + .grid, .board + p { margin-top: 14px; }
.swatch .btn { margin: 0 10px 10px; }
.page-head + .empty, .tabs + .empty { margin-top: 4px; }
@media (max-width: 480px) { .org-switch { max-width: 34vw; } .topbar { gap: 6px; padding: 10px; } .credits-pill { padding: 6px 10px; } }
.persona dl { margin: 0; }
.plan h2 { margin: 10px 0 2px; }
.chat { height: calc(100vh - 63px - var(--nav-h) - 130px); height: calc(100dvh - 63px - var(--nav-h) - 130px); }
@media (min-width: 960px) { .chat { height: calc(100vh - 63px - 150px); height: calc(100dvh - 63px - 150px); } }
