/* ==========================================================================
   VettaAI Freelance Network — design system
   Concept: a dispatch board of machine specialists, not a warm gig bazaar.
   Dark is the default; light is a genuine second theme, not an inversion.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --violet: #6D4AFF;
  --violet-soft: #8A6DFF;
  --teal: #00C2A8;
  --amber: #F0B429;
  --rose: #E0523B;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 72px;

  --shell: 1220px;
  --nav-h: 68px;
  --ease: cubic-bezier(.32, .72, .28, 1);
}

[data-theme='dark'] {
  --ink: #0F1117;
  --surface: #161A23;
  --raised: #1D222D;
  --line: #272D3A;
  --line-soft: #1F2531;
  --text: #E8EAF0;
  --text-2: #B4BAC9;
  --muted: #8C93A6;
  --accent: var(--violet-soft);
  --accent-ink: #ffffff;
  --field: #12151D;
  --overlay: rgba(8, 10, 15, .72);
}

[data-theme='light'] {
  --ink: #F5F6F9;
  --surface: #FFFFFF;
  --raised: #FFFFFF;
  --line: #E1E4EC;
  --line-soft: #EDEFF4;
  --text: #141824;
  --text-2: #3D4457;
  --muted: #5C6478;
  --accent: #5B37E8;
  --accent-ink: #ffffff;
  --field: #FFFFFF;
  --overlay: rgba(20, 24, 36, .55);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.018em;
  line-height: 1.18;
  margin: 0 0 var(--sp-3);
}
h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
h3 { font-size: 1.16rem; }
p  { margin: 0 0 var(--sp-4); }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.shell { width: min(100% - 40px, var(--shell)); margin-inline: auto; }
.stack > * + * { margin-top: var(--sp-4); }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.small { font-size: .845rem; }
.mono-num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------- header --- */
.masthead {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  height: var(--nav-h);
  display: flex; align-items: center; gap: var(--sp-5);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; font-size: 1.06rem; }
.brand__mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(145deg, var(--violet), #3B2A9E);
  display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.brand__mark span { transform: translateY(.5px); }

.mainnav { display: flex; align-items: center; gap: var(--sp-5); margin-inline-start: var(--sp-2); }
.mainnav a { color: var(--text-2); font-size: .93rem; font-weight: 500; padding: 6px 0; border-bottom: 1.5px solid transparent; }
.mainnav a:hover { color: var(--text); }
.mainnav a[aria-current='page'] { color: var(--text); border-bottom-color: var(--accent); }

.masthead__end { margin-inline-start: auto; display: flex; align-items: center; gap: var(--sp-2); }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); background: transparent; color: var(--text-2);
  border-radius: var(--r-sm); cursor: pointer; transition: .18s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--muted); }

.langpick { position: relative; }
.langpick__btn {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px;
  border: 1px solid var(--line); background: transparent; color: var(--text-2);
  border-radius: var(--r-sm); cursor: pointer; font: inherit; font-size: .85rem;
  text-transform: uppercase; letter-spacing: .04em;
}
.langpick__btn:hover { color: var(--text); border-color: var(--muted); }
.langpick__menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 168px;
  background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 5px; z-index: 80;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.langpick__menu button {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 10px; background: none; border: 0; color: var(--text-2);
  font: inherit; font-size: .9rem; cursor: pointer; border-radius: var(--r-sm); text-align: start;
}
.langpick__menu button:hover { background: var(--surface); color: var(--text); }
.langpick__menu button[aria-selected='true'] { color: var(--accent); }
.langpick__menu code { font-size: .72rem; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }

.navtoggle { display: none; }

/* -------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 550; font-size: .93rem;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; transition: .18s var(--ease); white-space: nowrap;
}
.btn--primary { background: var(--violet); color: #fff; }
.btn--primary:hover { background: #5B37E8; }
.btn--ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--muted); background: var(--surface); }
.btn--quiet { color: var(--text-2); background: transparent; padding-inline: 8px; }
.btn--quiet:hover { color: var(--text); }
.btn--danger { border-color: var(--line); color: var(--rose); background: transparent; }
.btn--danger:hover { border-color: var(--rose); }
.btn--block { width: 100%; }
.btn--sm { padding: 7px 13px; font-size: .86rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* --------------------------------------------------------------- forms --- */
.field { display: block; margin-bottom: var(--sp-4); }
.field__label { display: block; font-size: .86rem; font-weight: 550; color: var(--text-2); margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--field); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; transition: border-color .16s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); outline: none; }
.textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 51%, calc(100% - 11px) 51%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.field__error { color: var(--rose); font-size: .82rem; margin-top: 5px; display: block; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; color: var(--text-2); }
.check input { margin-top: 3px; accent-color: var(--violet); }

.notice {
  border: 1px solid var(--line); border-inline-start: 3px solid var(--accent);
  background: var(--surface); border-radius: var(--r-sm);
  padding: 11px 14px; font-size: .88rem; color: var(--text-2);
}
.notice--error { border-inline-start-color: var(--rose); color: var(--text); }
.notice--ok { border-inline-start-color: var(--teal); }

/* ----------------------------------------------------------------- hero -- */
.hero { padding: var(--sp-8) 0 var(--sp-7); position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -30% 45% 40% -20%;
  background: radial-gradient(closest-side, rgba(109,74,255,.20), transparent 72%);
  pointer-events: none;
}
[data-theme='light'] .hero::before { background: radial-gradient(closest-side, rgba(109,74,255,.13), transparent 72%); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: var(--sp-8); align-items: center; position: relative; }
.hero__lede { font-size: 1.09rem; color: var(--text-2); max-width: 46ch; }

.searchbar {
  display: flex; gap: 8px; padding: 7px; margin-top: var(--sp-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.searchbar input {
  flex: 1; min-width: 0; background: none; border: 0; color: var(--text);
  font: inherit; padding: 9px 11px;
}
.searchbar input:focus { outline: none; }

.chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-4); align-items: center; }
.chiprow__label { font-size: .82rem; color: var(--muted); margin-inline-end: 2px; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--text-2);
  border-radius: var(--r-pill); padding: 5px 13px; font: inherit; font-size: .83rem;
  cursor: pointer; transition: .16s var(--ease);
}
.chip:hover { border-color: var(--muted); color: var(--text); }
.chip[aria-pressed='true'] { background: var(--violet); border-color: var(--violet); color: #fff; }

/* The dispatch panel: the one place motion and density are spent. */
.dispatch {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 60%, var(--ink)));
  overflow: hidden;
}
.dispatch__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-display); font-size: .85rem; letter-spacing: .01em; color: var(--text-2);
}
.pulse { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--teal); }
.pulse::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .38; transform: scale(.72); } }

.dispatch__row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  animation: slideIn .5s var(--ease) both;
}
.dispatch__row:last-child { border-bottom: 0; }
@keyframes slideIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.dispatch__row img { width: 34px; height: 34px; border-radius: 8px; display: block; }
.dispatch__name { font-weight: 550; font-size: .92rem; }
.dispatch__role { font-size: .79rem; color: var(--muted); }
.dispatch__meta { text-align: end; font-size: .78rem; color: var(--text-2); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .dispatch__row, .pulse::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* ----------------------------------------------------------- statistics -- */
.statband {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; margin-top: var(--sp-7);
}
.statband > div { background: var(--ink); padding: var(--sp-4) var(--sp-5); }
.statband strong {
  display: block; font-family: var(--font-display); font-size: 1.55rem;
  font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.statband span { font-size: .82rem; color: var(--muted); }

/* -------------------------------------------------------------- section -- */
.section { padding: var(--sp-8) 0; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.section__head p { margin: 6px 0 0; color: var(--muted); font-size: .93rem; }

/* --------------------------------------------------------------- cards --- */
.grid { display: grid; gap: var(--sp-4); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.agentcard {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); padding: var(--sp-4);
  transition: border-color .18s var(--ease), transform .18s var(--ease);
  position: relative;
}
.agentcard:hover { border-color: var(--muted); transform: translateY(-2px); }
.agentcard__top { display: flex; gap: 12px; align-items: start; }
.agentcard__avatar { width: 46px; height: 46px; border-radius: 9px; flex: none; display: block; }
.agentcard__name { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.agentcard__role { font-size: .82rem; color: var(--muted); }
.agentcard__tag { margin: var(--sp-3) 0 var(--sp-4); font-size: .89rem; color: var(--text-2); flex: 1; }
.agentcard__skills { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: var(--sp-4); }
.tag {
  font-size: .74rem; padding: 3px 8px; border-radius: var(--r-sm);
  background: var(--raised); border: 1px solid var(--line-soft); color: var(--text-2);
}
.agentcard__foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--sp-3); border-top: 1px solid var(--line-soft); font-size: .84rem;
}
.price { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.price small { font-weight: 400; color: var(--muted); font-size: .74rem; display: block; }

.rating { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.rating svg { width: 13px; height: 13px; fill: var(--amber); }
.rating span { color: var(--muted); font-size: .8rem; }

.flag {
  position: absolute; top: 12px; inset-inline-end: 12px;
  font-size: .68rem; letter-spacing: .05em; padding: 3px 7px;
  border-radius: var(--r-sm); background: var(--violet); color: #fff;
}

/* categories */
.cattile {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-5);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4);
  background: var(--surface); min-height: 118px; transition: .18s var(--ease);
}
.cattile:hover { border-color: var(--accent); }
.cattile strong { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; }
.cattile span { font-size: .81rem; color: var(--muted); }

/* reviews */
.quote {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); padding: var(--sp-4); font-size: .91rem;
}
.quote p { color: var(--text-2); }
.quote footer { display: flex; align-items: center; gap: 9px; font-size: .82rem; }
.quote footer b { font-weight: 550; }

/* ------------------------------------------------------------ ai banner -- */
.aibanner {
  display: flex; align-items: center; gap: 11px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); padding: 11px 15px;
  font-size: .86rem; color: var(--text-2);
}
.aibanner svg { width: 17px; height: 17px; flex: none; stroke: var(--accent); }

/* ------------------------------------------------------ browse / filters -- */
.browse { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: var(--sp-6); align-items: start; padding: var(--sp-6) 0 var(--sp-8); }
.filters { position: sticky; top: calc(var(--nav-h) + 16px); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4); background: var(--surface); }
.filters h3 { font-size: .95rem; margin-bottom: var(--sp-4); }
.filters__group { margin-bottom: var(--sp-5); }
.filters__group > span { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.catlist { display: flex; flex-direction: column; gap: 2px; }
.catlist button {
  display: flex; justify-content: space-between; gap: 8px; width: 100%;
  padding: 6px 9px; background: none; border: 0; border-radius: var(--r-sm);
  color: var(--text-2); font: inherit; font-size: .88rem; cursor: pointer; text-align: start;
}
.catlist button:hover { background: var(--raised); color: var(--text); }
.catlist button[aria-pressed='true'] { background: var(--raised); color: var(--accent); }
.catlist small { color: var(--muted); font-variant-numeric: tabular-nums; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.pager { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); margin-top: var(--sp-6); }

/* -------------------------------------------------------------- profile -- */
.profile { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: var(--sp-6); align-items: start; padding: var(--sp-6) 0 var(--sp-8); }
.profile__head { display: flex; gap: var(--sp-4); align-items: start; margin-bottom: var(--sp-5); }
.profile__avatar { width: 84px; height: 84px; border-radius: 14px; flex: none; }
.profile__meta { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-3); font-size: .87rem; color: var(--text-2); }
.panel { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: var(--sp-5); }
.panel + .panel { margin-top: var(--sp-4); }
.panel h2 { font-size: 1.16rem; }

.tiers { position: sticky; top: calc(var(--nav-h) + 16px); }
.tier { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: var(--sp-4); margin-bottom: var(--sp-3); cursor: pointer; transition: .16s var(--ease); }
.tier:hover { border-color: var(--muted); }
.tier[aria-pressed='true'] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tier__top { display: flex; justify-content: space-between; align-items: baseline; }
.tier__name { font-family: var(--font-display); font-weight: 600; }
.tier__price { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.tier__facts { font-size: .82rem; color: var(--muted); margin-top: 6px; }

.workitem { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.workitem__art { height: 108px; position: relative; }
.workitem__body { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.workitem h4 { font-size: .95rem; margin: 0 0 5px; font-family: var(--font-display); }
.workitem p { font-size: .84rem; color: var(--muted); margin: 0; }

.bars { display: grid; gap: 6px; }
.bars__row { display: grid; grid-template-columns: 42px 1fr 38px; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); }
.bars__track { height: 6px; background: var(--raised); border-radius: var(--r-pill); overflow: hidden; }
.bars__fill { height: 100%; background: var(--amber); }

.review { padding: var(--sp-4) 0; border-bottom: 1px solid var(--line-soft); }
.review:last-child { border-bottom: 0; }
.review__head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.review__head b { font-weight: 550; font-size: .92rem; }

/* --------------------------------------------------------------- modal --- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: var(--overlay); }
.modal__box { width: min(100%, 620px); max-height: 86vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-6); }
.modal__head { display: flex; align-items: start; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-4); }

/* ------------------------------------------------------------- messages -- */
.chat { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: var(--sp-4); height: calc(100vh - var(--nav-h) - 32px); padding: var(--sp-4) 0; }
.threads { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow-y: auto; }
.thread { display: grid; grid-template-columns: 38px 1fr; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.thread:hover { background: var(--raised); }
.thread[aria-current='true'] { background: var(--raised); box-shadow: inset 3px 0 0 var(--accent); }
.thread img { width: 38px; height: 38px; border-radius: 8px; }
.thread b { font-size: .9rem; font-weight: 550; display: block; }
.thread p { margin: 2px 0 0; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.convo { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.convo__head { display: flex; align-items: center; gap: 11px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.convo__head img { width: 36px; height: 36px; border-radius: 8px; }
.convo__log { flex: 1; overflow-y: auto; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.bubble { max-width: 74%; padding: 12px 15px; border-radius: 13px; font-size: .92rem; line-height: 1.58; white-space: pre-wrap; word-wrap: break-word; }
.bubble--agent { align-self: flex-start; background: var(--raised); border: 1px solid var(--line-soft); border-bottom-left-radius: 4px; }
.bubble--user { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 4px; }
.bubble--system { align-self: center; background: none; border: 1px dashed var(--line); color: var(--muted); font-size: .8rem; max-width: 90%; text-align: center; }
.bubble time { display: block; font-size: .7rem; opacity: .6; margin-top: 6px; }
.composer { display: flex; gap: 9px; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; }

/* ---------------------------------------------------------------- table -- */
.tablewrap { border: 1px solid var(--line); border-radius: var(--r-md); overflow-x: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 11px 15px; text-align: start; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { font-weight: 550; color: var(--muted); font-size: .8rem; background: var(--raised); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--raised); }

.pill { display: inline-block; padding: 2px 9px; border-radius: var(--r-pill); font-size: .76rem; border: 1px solid var(--line); color: var(--text-2); }
.pill--ok { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 45%, transparent); }
.pill--warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.pill--bad { color: var(--rose); border-color: color-mix(in srgb, var(--rose) 45%, transparent); }
.pill--live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* ------------------------------------------------------------ dashboard -- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-4); }
.kpi { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: var(--sp-4) var(--sp-5); }
.kpi strong { display: block; font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi span { font-size: .84rem; color: var(--muted); }

.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-5); overflow-x: auto; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  font: inherit; font-size: .92rem; padding: 10px 14px; cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected='true'] { color: var(--text); border-bottom-color: var(--accent); }

/* ----------------------------------------------------------------- auth -- */
.authpage { display: grid; place-items: center; min-height: calc(100vh - var(--nav-h) - 220px); padding: var(--sp-7) 0; }
.authcard { width: min(100%, 428px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: var(--sp-6); }
.authcard h1 { font-size: 1.55rem; margin-bottom: 6px; }

/* ---------------------------------------------------------------- legal -- */
.legal { display: grid; grid-template-columns: 262px minmax(0, 1fr); gap: var(--sp-6); align-items: start; padding: var(--sp-6) 0 var(--sp-8); }
.legal__nav { position: sticky; top: calc(var(--nav-h) + 16px); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: var(--sp-3); }
.legal__nav a { display: block; padding: 7px 11px; border-radius: var(--r-sm); font-size: .88rem; color: var(--text-2); }
.legal__nav a:hover { background: var(--raised); color: var(--text); }
.legal__nav a[aria-current='page'] { background: var(--raised); color: var(--accent); }
.prose { max-width: 74ch; }
.prose h2 { font-size: 1.24rem; margin: var(--sp-6) 0 var(--sp-3); }
.prose h2:first-of-type { margin-top: var(--sp-5); }
.prose p { color: var(--text-2); }

/* --------------------------------------------------------------- footer -- */
.footer { border-top: 1px solid var(--line); padding: var(--sp-7) 0 var(--sp-6); margin-top: var(--sp-8); background: var(--surface); }
.footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--sp-6); }
.footer h4 { font-size: .84rem; color: var(--muted); font-weight: 550; letter-spacing: .01em; margin-bottom: var(--sp-3); font-family: var(--font-body); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { font-size: .88rem; color: var(--text-2); }
.footer a:hover { color: var(--text); }
.footer__base { display: flex; flex-wrap: wrap; gap: var(--sp-4); justify-content: space-between; border-top: 1px solid var(--line); margin-top: var(--sp-6); padding-top: var(--sp-4); font-size: .82rem; color: var(--muted); }

/* -------------------------------------------------------------- skeleton -- */
.skel { background: linear-gradient(90deg, var(--raised) 25%, var(--line) 50%, var(--raised) 75%); background-size: 300% 100%; animation: shimmer 1.5s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { from { background-position: 300% 0; } to { background-position: -300% 0; } }
.skel--card { height: 208px; border-radius: var(--r-md); }

.empty { text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-md); }

/* ---------------------------------------------------------------- toast -- */
.toasts { position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 300; display: grid; gap: 8px; }
.toast { background: var(--raised); border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); border-radius: var(--r-sm); padding: 11px 15px; font-size: .88rem; max-width: 340px; box-shadow: 0 12px 30px rgba(0,0,0,.3); animation: slideIn .25s var(--ease); }
.toast--bad { border-inline-start-color: var(--rose); }
.toast--good { border-inline-start-color: var(--teal); }

/* ---------------------------------------------------------- responsive --- */
@media (max-width: 1040px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .profile, .browse, .legal { grid-template-columns: 1fr; }
  .filters, .tiers, .legal__nav { position: static; }
  .chat { grid-template-columns: 1fr; height: auto; }
  .threads { max-height: 280px; }
  .convo { min-height: 62vh; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
  .navtoggle { display: grid; }
  .mainnav {
    display: none; position: absolute; inset-inline: 0; top: var(--nav-h);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: var(--sp-3);
  }
  .mainnav.is-open { display: flex; }
  .mainnav a { padding: 11px 12px; border-bottom: 0; border-radius: var(--r-sm); }
  .mainnav a[aria-current='page'] { background: var(--raised); }
  .statband { grid-template-columns: repeat(2, 1fr); }
  .bubble { max-width: 88%; }
  .shell { width: calc(100% - 32px); }
  .section { padding: var(--sp-6) 0; }
  .hero { padding: var(--sp-6) 0; }
}
@media (max-width: 520px) {
  .footer__grid { grid-template-columns: 1fr; }
  .searchbar { flex-direction: column; }
  .searchbar .btn { width: 100%; }
  .profile__head { flex-direction: column; }
}
