/* ==========================================================
   Palavra — design tokens
   ========================================================== */
:root {
  --bg: #f6f2ea;
  --bg-2: #efe9dd;
  --surface: #fffdf8;
  --surface-2: #faf6ee;
  --line: #e4dccb;
  --line-2: #d6ccb7;
  --ink: #1c2233;
  --ink-2: #4a5164;
  --ink-3: #7a7f8e;
  --accent: #e8553d;
  --accent-ink: #ffffff;
  --accent-soft: #fde4dc;
  --teal: #1f8a7a;
  --teal-soft: #d6f0ea;
  --gold: #c99a2e;
  --gold-soft: #f7ecd0;
  --blue: #3563d8;
  --blue-soft: #dfe7fb;
  --online: #2fb36a;
  --shadow-sm: 0 1px 2px rgba(28,34,51,.06), 0 1px 1px rgba(28,34,51,.04);
  --shadow: 0 6px 24px -8px rgba(28,34,51,.18), 0 2px 6px rgba(28,34,51,.06);
  --shadow-lg: 0 30px 80px -20px rgba(28,34,51,.35);
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --topbar-h: 64px;
  --nav-w: 232px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11141d; --bg-2: #161a25; --surface: #1a1f2c; --surface-2: #202636;
    --line: #2a3142; --line-2: #374055; --ink: #eef0f5; --ink-2: #b8bdcb; --ink-3: #8a90a2;
    --accent: #ff6b4f; --accent-soft: #3a211d; --teal: #3cc2ad; --teal-soft: #15302d;
    --gold: #e3b955; --gold-soft: #33291a; --blue: #7c9cf5; --blue-soft: #1d2741;
    --shadow: 0 8px 30px -10px rgba(0,0,0,.6); --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11141d; --bg-2: #161a25; --surface: #1a1f2c; --surface-2: #202636;
  --line: #2a3142; --line-2: #374055; --ink: #eef0f5; --ink-2: #b8bdcb; --ink-3: #8a90a2;
  --accent: #ff6b4f; --accent-soft: #3a211d; --teal: #3cc2ad; --teal-soft: #15302d;
  --gold: #e3b955; --gold-soft: #33291a; --blue: #7c9cf5; --blue-soft: #1d2741;
  --shadow: 0 8px 30px -10px rgba(0,0,0,.6); --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

/* ==========================================================
   Base
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
kbd { font-family: var(--font); font-size: 11px; padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--ink-3); background: var(--surface-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.only-mobile { display: none !important; }

/* ==========================================================
   Top bar
   ========================================================== */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 21px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand-mark svg { width: 26px; height: 26px; stroke: none; }
.brand-mark svg circle { fill: var(--accent); }
.search-trigger {
  flex: 1; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-3); text-align: left; transition: border-color .15s, box-shadow .15s;
}
.search-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.dot-badge { position: absolute; top: 1px; right: 0px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); box-sizing: content-box; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: none; } :root:not([data-theme="light"]) .i-moon { display: block; } }
.me-btn { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; }
.me-btn:hover { border-color: var(--line-2); }

.dropdown { position: relative; }
.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px;
  animation: pop .14s ease-out;
}
.dropdown-panel > a, .dropdown-panel > button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.dropdown-panel > a:hover, .dropdown-panel > button:hover { background: var(--bg-2); }
.notif-panel { width: 360px; max-width: calc(100vw - 24px); padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 420px; overflow: auto; }
.notif { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.notif:last-child { border-bottom: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ==========================================================
   Shell / side nav
   ========================================================== */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.sidenav { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow: auto; padding: 18px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.sidenav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; transition: background .12s, color .12s; }
.sidenav a:hover { background: var(--bg-2); color: var(--ink); }
.sidenav a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); border: 1px solid var(--line); padding: 9px 11px; }
.sidenav a.active svg { color: var(--accent); }
.nav-count { margin-left: auto; font-size: 11px; background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 7px; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav-online { margin-top: auto; padding: 14px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.nav-online b { font-family: var(--display); font-size: 22px; display: block; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 0 rgba(47,179,106,.6); animation: pulse 2s infinite; margin-right: 6px; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(47,179,106,0); } 100% { box-shadow: 0 0 0 0 rgba(47,179,106,0); } }
.scrim { position: fixed; inset: 0; background: rgba(10,12,20,.45); z-index: 44; }

main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; outline: none; }
.page { max-width: 1240px; margin: 0 auto; animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { color: var(--ink-2); margin-top: 6px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

/* ==========================================================
   Primitives
   ========================================================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; font-weight: 600; font-size: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); transition: transform .08s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); border-color: transparent; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-2); box-shadow: none; border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn.is-on { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.btn-block { width: 100%; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 16px; }
.link { color: var(--accent); font-weight: 600; font-size: 14px; }
.link:hover { text-decoration: underline; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--bg-2); color: var(--ink-2); font-size: 12.5px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-teal { background: var(--teal-soft); color: var(--teal); }
.chip-gold { background: var(--gold-soft); color: var(--gold); }
.chip-blue { background: var(--blue-soft); color: var(--blue); }
button.chip:hover { border-color: var(--line-2); }
button.chip.on { background: var(--ink); color: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 100px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a7f8e' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 32px; }
.range-row { display: flex; align-items: center; gap: 8px; }
.range-row .input { width: 76px; }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.toggle input { position: absolute; opacity: 0; }
.toggle .track { width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .15s; flex-shrink: 0; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.toggle input:checked + .track { background: var(--teal); }
.toggle input:checked + .track::after { transform: translateX(16px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; background: var(--bg-2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button svg { width: 16px; height: 16px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--accent); }
.tabs button .count { font-size: 11px; background: var(--bg-2); padding: 1px 6px; border-radius: 99px; margin-left: 4px; }

/* Avatars */
.av { display: inline-block; vertical-align: middle; position: relative; flex-shrink: 0; border-radius: 50%; width: var(--s, 44px); height: var(--s, 44px); }
.av svg { width: 100%; height: 100%; stroke: none; border-radius: 50%; display: block; }
.av .on-dot { position: absolute; right: 2%; bottom: 2%; width: 26%; height: 26%; min-width: 9px; min-height: 9px; border-radius: 50%; background: var(--online); border: 2px solid var(--surface); }
.flag { font-size: 1.05em; line-height: 1; }

.level { display: inline-flex; gap: 2px; vertical-align: middle; }
.level i { width: 6px; height: 10px; border-radius: 2px; background: var(--line-2); }
.level i.f { background: var(--teal); }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty svg { width: 42px; height: 42px; margin: 0 auto 10px; opacity: .5; }

/* ==========================================================
   Landing
   ========================================================== */
.hero { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 30px 0 50px; }
.hero h1 { font-size: clamp(38px, 6vw, 68px); line-height: 1.02; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; color: var(--accent); position: relative; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .14em; background: var(--accent-soft); z-index: -1; border-radius: 4px; }
.hero-lead { font-size: 18px; color: var(--ink-2); max-width: 540px; margin: 18px 0 28px; }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 36px; flex-wrap: wrap; }
.hero-stats b { font-family: var(--display); font-size: 30px; display: block; }
.hero-stats span { font-size: 13px; color: var(--ink-3); }
.orbit { position: relative; aspect-ratio: 1; max-width: 480px; width: 100%; justify-self: center; }
.orbit-ring { position: absolute; inset: 0; border: 1.5px dashed var(--line-2); border-radius: 50%; }
.orbit-ring.r2 { inset: 16%; }
.orbit-ring.r3 { inset: 32%; background: radial-gradient(circle, var(--accent-soft), transparent 70%); border-style: solid; border-color: var(--line); }
.orbit-core { position: absolute; inset: 40%; border-radius: 50%; background: var(--accent); display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 800; font-size: 13px; text-align: center; box-shadow: var(--shadow-lg); }
.orbit-spin { position: absolute; inset: 0; animation: spin 80s linear infinite; }
.orbit-spin.rev { animation-direction: reverse; animation-duration: 60s; inset: 16%; }
.orbit-node { position: absolute; transform: translate(-50%, -50%); }
.orbit-node .bubble { animation: spin 80s linear infinite reverse; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); padding: 5px 12px 5px 5px; border-radius: 99px; box-shadow: var(--shadow); white-space: nowrap; font-size: 13px; font-weight: 600; }
.orbit-spin.rev .orbit-node .bubble { animation: spin 60s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0 40px; }
.feature { padding: 24px; }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--ink-2); font-size: 14px; }
.ticker { overflow: hidden; border-block: 1px solid var(--line); padding: 14px 0; margin: 10px 0 40px; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ticker-track { display: flex; gap: 28px; width: max-content; animation: ticker 50s linear infinite; }
.ticker-track span { display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
@keyframes ticker { to { transform: translateX(-50%); } }
.cta-band { padding: 40px; border-radius: var(--r-lg); background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cta-band h2 { font-size: 30px; }
.cta-band p { opacity: .75; margin-top: 6px; }

/* ==========================================================
   Dashboard
   ========================================================== */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.welcome { padding: 24px; display: flex; gap: 20px; align-items: center; background: linear-gradient(120deg, var(--surface), var(--accent-soft)); }
.welcome h2 { font-size: 26px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { padding: 16px; }
.stat .label { display: flex; align-items: center; gap: 6px; }
.stat b { font-family: var(--display); font-size: 28px; display: block; margin-top: 4px; }
.stat .delta { font-size: 12px; color: var(--teal); font-weight: 600; }
.h-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 16px 20px 20px; scroll-snap-type: x mandatory; }
.h-scroll::-webkit-scrollbar { height: 8px; } .h-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 9px; }
.mini-card { scroll-snap-align: start; flex: 0 0 150px; text-align: center; padding: 16px 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .15s, box-shadow .15s; }
.mini-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mini-card .nm { font-weight: 600; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .body { flex: 1; min-width: 0; font-size: 14px; }
.feed-item .quote { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--accent); color: var(--ink-2); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; transition: background .12s; }
.list-row:hover { background: var(--surface-2); }
.list-row .info { flex: 1; min-width: 0; }
.list-row .nm { font-weight: 600; font-size: 14px; }
.word-card { padding: 20px; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.word-card .w { font-family: var(--display); font-size: 32px; font-weight: 800; margin: 6px 0 2px; }
.word-card .muted { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.progress { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--accent)); border-radius: inherit; }

/* ==========================================================
   Search
   ========================================================== */
.search-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
.filters { position: sticky; top: calc(var(--topbar-h) + 20px); padding: 18px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - var(--topbar-h) - 40px); overflow: auto; }
.filters-head { display: flex; justify-content: space-between; align-items: center; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { flex: 1; min-width: 180px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.active-filters .chip { cursor: pointer; }
.active-filters .chip::after { content: "×"; margin-left: 2px; font-size: 14px; opacity: .6; }
.results-meta { font-size: 14px; color: var(--ink-3); margin-bottom: 12px; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pcard { position: relative; display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pcard-cover { height: 70px; }
.pcard-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard .av { margin-top: -32px; border: 4px solid var(--surface); box-sizing: content-box; }
.pcard .av .on-dot { border-color: var(--surface); }
.pcard .nm { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.pcard .loc { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.pcard .bio { font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .langs { font-size: 12.5px; display: grid; gap: 4px; }
.pcard .langs div { display: flex; gap: 6px; align-items: center; }
.pcard .langs .k { color: var(--ink-3); width: 54px; flex-shrink: 0; }
.pcard-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
.pcard-actions .btn { flex: 1; }
.fav-btn { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.85); display: grid; place-items: center; color: #1c2233; }
.fav-btn svg { width: 17px; height: 17px; }
.fav-btn.on { color: var(--accent); }
.fav-btn.on svg { fill: var(--accent); }

.list-cards { display: flex; flex-direction: column; gap: 10px; }
.lcard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px; }
.lcard .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-3); margin-top: 4px; }

.pager { display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pager button { min-width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; }
.pager button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pager button:disabled { opacity: .4; cursor: default; }

/* ==========================================================
   Profile
   ========================================================== */
.profile-hero { overflow: hidden; margin-bottom: 20px; }
.profile-cover { height: 190px; position: relative; }
.profile-cover .cover-btn { position: absolute; right: 14px; top: 14px; }
.profile-top { display: flex; gap: 22px; padding: 0 28px 24px; align-items: flex-end; flex-wrap: wrap; }
.profile-top .av { margin-top: -60px; border: 5px solid var(--surface); box-sizing: content-box; }
.profile-top .who { flex: 1; min-width: 220px; padding-top: 14px; }
.profile-top .who h1 { font-size: 30px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-top .sub { color: var(--ink-3); display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 6px; font-size: 14px; }
.profile-top .sub span { display: inline-flex; align-items: center; gap: 5px; }
.profile-top .sub svg { width: 15px; height: 15px; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-stats { display: flex; border-top: 1px solid var(--line); }
.profile-stats div { flex: 1; text-align: center; padding: 14px 6px; border-right: 1px solid var(--line); }
.profile-stats div:last-child { border-right: 0; }
.profile-stats b { font-family: var(--display); font-size: 20px; display: block; }
.profile-stats span { font-size: 12px; color: var(--ink-3); }
.profile-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-grid > div { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.lang-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.lang-row:last-child { border-bottom: 0; }
.lang-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.lang-bar i { display: block; height: 100%; background: var(--teal); border-radius: inherit; }
.lang-bar.native i { background: var(--accent); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery button { aspect-ratio: 1; border-radius: 12px; overflow: hidden; transition: transform .15s; }
.gallery button:hover { transform: scale(1.02); }
.gallery svg { width: 100%; height: 100%; stroke: none; }
.wall-post { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.wall-post:last-child { border-bottom: 0; }
.wall-post .body { flex: 1; min-width: 0; font-size: 14px; }
.composer { display: flex; gap: 10px; align-items: flex-start; }
.composer .textarea { min-height: 60px; }
.match-meter { display: flex; align-items: center; gap: 14px; }
.ring { --p: 70; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--bg-2) 0); display: grid; place-items: center; flex-shrink: 0; }
.ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-family: var(--display); }

/* ==========================================================
   Messages
   ========================================================== */
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr) 280px; height: calc(100vh - var(--topbar-h) - 56px); min-height: 520px; overflow: hidden; }
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inbox-list-head { padding: 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.threads { overflow: auto; flex: 1; }
.thread { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; align-items: center; }
.thread:hover { background: var(--surface-2); }
.thread.active { background: var(--accent-soft); }
.thread .info { flex: 1; min-width: 0; }
.thread .top { display: flex; justify-content: space-between; gap: 8px; }
.thread .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread .time { font-size: 12px; color: var(--ink-3); flex-shrink: 0; }
.thread .prev { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread.unread .prev { color: var(--ink); font-weight: 600; }
.thread .ub { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.convo { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.convo-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.convo-head .info { flex: 1; min-width: 0; }
.back-btn { display: none !important; }
.radio { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.radio input { accent-color: var(--accent); width: 18px; height: 18px; }
.convo-body { flex: 1; overflow: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 6px; background: radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 22px 22px; }
.day-sep { align-self: center; font-size: 12px; color: var(--ink-3); background: var(--surface); padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); margin: 10px 0; }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; max-width: 78%; }
.bubble-row.me { align-self: flex-end; flex-direction: row-reverse; }
.msg { padding: 9px 13px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.45; box-shadow: var(--shadow-sm); position: relative; overflow-wrap: anywhere; }
.bubble-row.me .msg { background: var(--accent); color: #fff; border-color: transparent; border-bottom-right-radius: 5px; }
.bubble-row:not(.me) .msg { border-bottom-left-radius: 5px; }
.msg .t .tr-btn { display: inline; }
.msg .t { font-size: 11px; opacity: .6; margin-top: 3px; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.msg .tr { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line-2); font-size: 13px; color: var(--ink-2); font-style: italic; }
.msg .tr-btn { display: block; font-size: 11.5px; color: var(--blue); font-weight: 600; margin-top: 4px; }
.msg .corr { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--teal-soft); color: var(--teal); font-size: 13px; }
.msg .corr s { color: var(--accent); }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.convo-foot { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.quick-replies { display: flex; gap: 6px; overflow-x: auto; }
.compose-row { display: flex; gap: 8px; align-items: flex-end; }
.compose-row .textarea { min-height: 44px; max-height: 140px; height: 44px; resize: none; padding: 11px 12px; }
.emoji-pop { position: absolute; bottom: 64px; left: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; z-index: 5; }
.emoji-pop button { width: 34px; height: 34px; border-radius: 8px; font-size: 20px; }
.emoji-pop button:hover { background: var(--bg-2); }
.convo-side { border-left: 1px solid var(--line); padding: 20px; overflow: auto; display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.convo-side .center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.local-time { font-family: var(--display); font-size: 26px; font-weight: 700; }

/* ==========================================================
   Exchange
   ========================================================== */
.exchange-hero { padding: 24px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; margin-bottom: 20px; }
.ex-side h3 { margin-bottom: 10px; font-size: 14px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.ex-arrow { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.ex-arrow svg { width: 26px; height: 26px; }
.match-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.match-card .top { display: flex; gap: 12px; align-items: center; }
.match-card .swap { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; padding: 10px; border-radius: 12px; background: var(--surface-2); font-size: 13px; text-align: center; }
.match-card .swap b { display: block; font-size: 14px; }
.match-card .swap svg { width: 18px; height: 18px; color: var(--accent); }

/* ==========================================================
   Forums
   ========================================================== */
.forum-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 26px; }
.forum-cat { padding: 18px; display: flex; gap: 14px; transition: transform .15s, box-shadow .15s; }
.forum-cat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.forum-cat .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.forum-cat p { font-size: 13.5px; color: var(--ink-2); margin: 4px 0 8px; }
.topic-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 80px 150px; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.topic-row:last-child { border-bottom: 0; }
.topic-row:hover { background: var(--surface-2); }
.topic-row .t { font-weight: 600; }
.topic-row .num { text-align: center; font-size: 13px; color: var(--ink-3); }
.topic-row .num b { display: block; color: var(--ink); font-size: 15px; }
.post { display: grid; grid-template-columns: 160px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post-author { padding: 20px; border-right: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 13px; }
.post-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.post-body .actions { display: flex; gap: 6px; margin-top: auto; }
.like-btn.on { color: var(--accent); }
.like-btn.on svg { fill: var(--accent); }

/* ==========================================================
   World
   ========================================================== */
.world-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.bars { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; border-radius: 8px; padding: 2px 4px; }
.bar-row:hover { background: var(--surface-2); }
.bar-row .track { height: 14px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.country-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.country-tile { padding: 14px; display: flex; gap: 10px; align-items: center; transition: transform .15s, box-shadow .15s; text-align: left; }
.country-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.country-tile .flag { font-size: 28px; }
.country-tile b { display: block; font-size: 14px; }
.clocks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 18px 20px; }
.clock { padding: 12px; border-radius: 12px; background: var(--surface-2); }
.clock b { font-family: var(--display); font-size: 22px; display: block; }

/* ==========================================================
   Settings
   ========================================================== */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 20px); padding: 8px; display: flex; flex-direction: column; }
.settings-nav button { text-align: left; padding: 10px 12px; border-radius: 10px; font-weight: 500; color: var(--ink-2); }
.settings-nav button.on { background: var(--bg-2); color: var(--ink); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row p { font-size: 13px; color: var(--ink-3); }
.lang-edit { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; margin-bottom: 8px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.swatches button.on { box-shadow: 0 0 0 2px var(--ink); }

/* ==========================================================
   Overlays
   ========================================================== */
.palette, .modal, .lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(10,12,20,.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fadein .15s; }
@keyframes fadein { from { opacity: 0; } }
.palette-box { width: 100%; max-width: 620px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--line); overflow: hidden; animation: pop .15s; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input input { flex: 1; height: 56px; border: 0; background: transparent; font-size: 16px; outline: none; }
.palette-results { max-height: 420px; overflow: auto; padding: 6px; }
.palette-group { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; width: 100%; text-align: left; }
.palette-item.sel { background: var(--bg-2); }
.palette-item .sub { font-size: 12.5px; color: var(--ink-3); }
.palette-item .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-2); font-size: 18px; }
.modal { align-items: center; padding: 16px; }
.modal-box { width: 100%; max-width: 520px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: pop .15s; max-height: 90vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 4px; border-radius: 99px; background: var(--line); }
.steps i.on { background: var(--accent); }
.lightbox { align-items: center; flex-direction: column; gap: 14px; }
.lightbox .lb-img { width: min(80vw, 640px); aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.lightbox .lb-img svg { width: 100%; height: 100%; stroke: none; }
.lightbox .lb-nav { display: flex; gap: 10px; align-items: center; color: #fff; }
.lightbox .lb-nav .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; animation: toastin .25s ease-out; max-width: 360px; }
.toast.out { animation: toastout .2s ease-in forwards; }
.toast svg { color: var(--online); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastout { to { opacity: 0; transform: translateX(20px); } }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1180px) {
  .inbox { grid-template-columns: 300px minmax(0, 1fr); }
  .convo-side { display: none; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .world-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .only-mobile { display: grid !important; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidenav { position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: 270px; z-index: 45; background: var(--bg); transform: translateX(-100%); transition: transform .2s; padding-top: 20px; }
  .sidenav.open { transform: none; box-shadow: var(--shadow-lg); }
  .search-layout, .profile-grid, .settings { grid-template-columns: minmax(0, 1fr); }
  .filters, .settings-nav { position: static; max-height: none; }
  .settings-nav { flex-direction: row; overflow-x: auto; }
  .hero { grid-template-columns: 1fr; }
  .orbit { max-width: 340px; }
  .features { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .exchange-hero { grid-template-columns: 1fr; justify-items: start; }
  .ex-arrow { transform: rotate(90deg); }
  .topic-row { grid-template-columns: minmax(0, 1fr) 60px; }
  .topic-row .hide-sm { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .search-trigger span, .search-trigger kbd, .brand-name, .me-btn .me-name { display: none; }
  .search-trigger { flex: 0 0 40px; justify-content: center; padding: 0; margin: 0 0 0 auto; }
  main { padding: 18px 16px 50px; }
  .inbox { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--topbar-h) - 36px); }
  .inbox.has-active .inbox-list { display: none; }
  .inbox:not(.has-active) .convo { display: none; }
  .back-btn { display: grid !important; }
  .bubble-row { max-width: 92%; }
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-author { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); text-align: left; padding: 12px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .lcard { grid-template-columns: auto minmax(0, 1fr); }
  .lcard > :last-child { grid-column: 1 / -1; }
  .bar-row { grid-template-columns: 110px minmax(0, 1fr) 36px; }
  .profile-top { padding: 0 18px 20px; }
  .toasts { left: 16px; right: 16px; }
  .cta-band { padding: 26px; }
  .welcome { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
