/* RocketFreelancer — design system
   A single stylesheet: tokens, layout, components. No build step, no external
   fonts, no third-party CSS. */

:root {
  --brand-50:  #eef2ff;
  --brand-100: #dfe6ff;
  --brand-200: #c3d0ff;
  --brand-300: #9db0ff;
  --brand-400: #6f88fb;
  --brand-500: #3f66f5;
  --brand-600: #1b4df5;
  --brand-700: #1539c4;
  --brand-800: #122e9c;
  --brand-900: #0e2fa8;

  --accent-400: #34d8b4;
  --accent-500: #12b886;
  --accent-600: #0d946f;

  /* Ember is the conversion colour: pricing, primary calls to action. */
  --ember-300: #ffa98c;
  --ember-400: #ff8a63;
  --ember-500: #ff6a3d;
  --ember-600: #ea5327;
  --ember-700: #c13f18;

  --warn-500: #f59e0b;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --info-500: #0ea5e9;

  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef0f6;
  --bg-inset: #f0f2f8;
  --surface: #ffffff;
  --surface-2: #f8f9fd;

  --text: #0a0f1e;
  --text-muted: #5b6377;
  --text-subtle: #868ea3;
  --border: #e2e6f0;
  --border-strong: #cdd3e3;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12), 0 4px 8px rgba(16, 24, 40, .04);
  --shadow-xl: 0 24px 56px rgba(16, 24, 40, .16);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  --header-h: 68px;
  --container: 1240px;
}

[data-theme="dark"] {
  --bg: #0d1017;
  --bg-elevated: #151922;
  --bg-subtle: #1b202b;
  --bg-inset: #11151d;
  --surface: #151922;
  --surface-2: #1b202b;

  --text: #eef1f7;
  --text-muted: #a3abbf;
  --text-subtle: #7b849b;
  --border: #262c3a;
  --border-strong: #333b4d;

  --brand-500: #608dfc;
  --brand-600: #3b66f6;
  --accent-500: #12b886;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .5);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, .55);
  --shadow-xl: 0 28px 64px rgba(0, 0, 0, .65);
}

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

/* The `hidden` attribute must win over any display rule we set — otherwise an
   element like .modal-root (position:fixed; inset:0) keeps covering the page
   and swallows every click. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

h1, h2, h3, h4, h5 { margin: 0 0 .5rem; line-height: 1.22; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem); }
h3 { font-size: 1.16rem; }
h4 { font-size: 1rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
code, kbd { font-family: var(--mono); font-size: .88em; background: var(--bg-inset); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--brand-600); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.main { min-height: 62vh; padding-bottom: 4rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.06rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--brand-600); display: inline-flex; align-items: center; gap: .5rem; }
.brand-mark .icon { display: inline-flex; align-items: center; }
/* The locale picker may show a flag glyph or the shared globe icon. */
.flag { display: inline-flex; align-items: center; min-width: 1.4em; justify-content: center; }
.flag .icon { display: inline-flex; align-items: center; }
.brand-accent { color: var(--brand-600); }

.main-nav { display: flex; gap: .35rem; margin-left: .5rem; flex: 1; }
.main-nav a {
  color: var(--text-muted); font-weight: 500; font-size: .92rem;
  padding: .5rem .7rem; border-radius: var(--radius-sm);
}
.main-nav a:hover { color: var(--text); background: var(--bg-subtle); text-decoration: none; }
.main-nav a.active { color: var(--brand-600); background: var(--brand-50); }
[data-theme="dark"] .main-nav a.active { background: color-mix(in srgb, var(--brand-500) 18%, transparent); }

.header-actions { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  min-width: 38px; height: 38px; padding: 0 .55rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); cursor: pointer;
  font: inherit; font-size: .82rem; font-weight: 600;
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--text); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.auth-buttons { display: flex; gap: .5rem; }
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: .5rem; padding: .3rem .6rem .3rem .35rem;
  border-radius: var(--radius-full); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; color: var(--text); font: inherit;
}
.user-chip:hover { background: var(--bg-subtle); }
.user-chip .avatar { width: 28px; height: 28px; font-size: .72rem; }
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .4rem; z-index: 70;
}
.user-menu-panel a, .user-menu-panel button {
  display: flex; width: 100%; align-items: center; gap: .55rem;
  padding: .55rem .6rem; border-radius: var(--radius-sm);
  color: var(--text); font: inherit; font-size: .9rem; background: none; border: 0;
  cursor: pointer; text-align: left;
}
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--bg-subtle); text-decoration: none; }
.user-menu-sep { height: 1px; background: var(--border); margin: .35rem .3rem; }

.lang-menu {
  position: absolute; right: 1.25rem; top: calc(var(--header-h) - 4px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .35rem; min-width: 180px; z-index: 70;
}
.lang-menu button {
  display: flex; width: 100%; align-items: center; gap: .5rem; padding: .45rem .55rem;
  border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text); font: inherit; font-size: .88rem; text-align: left;
}
.lang-menu button:hover { background: var(--bg-subtle); }
.lang-menu button.active { color: var(--brand-600); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .58rem 1.05rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--brand-600); color: #fff;
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--brand-700); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-subtle); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); }
.btn-danger { background: var(--danger-500); }
.btn-danger:hover { background: var(--danger-600); }
.btn-success { background: var(--accent-500); }
.btn-success:hover { background: var(--accent-600); }
.btn-sm { padding: .36rem .7rem; font-size: .82rem; }
.btn-lg { padding: .78rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- cards / panels ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-xs);
}
.card-pad { padding: 1.15rem; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.15rem; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 1.15rem; }
.card-foot { padding: .9rem 1.15rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-md) var(--radius-md); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.panel-head { padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-body { padding: 1.15rem; }

/* ---------- forms ---------- */
.field { margin-bottom: 1rem; }
.field label, .label { display: block; font-size: .84rem; font-weight: 600; color: var(--text); margin-bottom: .32rem; }
.field .hint { font-size: .8rem; color: var(--text-subtle); margin-top: .3rem; }
.input, .select, .textarea {
  width: 100%; padding: .58rem .75rem; font: inherit; font-size: .92rem;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 18%, transparent);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger-500); }
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6377' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right .6rem center; background-size: 16px; padding-right: 2.1rem; }
.field-error { color: var(--danger-500); font-size: .8rem; margin-top: .3rem; }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.checkbox { display: flex; align-items: flex-start; gap: .55rem; font-size: .9rem; margin-bottom: .6rem; }
.checkbox input { margin-top: .22rem; accent-color: var(--brand-600); width: 16px; height: 16px; }

/* ---------- badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .55rem; border-radius: var(--radius-full);
  font-size: .74rem; font-weight: 700; letter-spacing: .01em;
  background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-brand   { background: var(--brand-50); color: var(--brand-700); border-color: transparent; }
.badge-success { background: color-mix(in srgb, var(--accent-500) 16%, transparent); color: var(--accent-600); border-color: transparent; }
.badge-warn    { background: color-mix(in srgb, var(--warn-500) 18%, transparent); color: #a76a06; border-color: transparent; }
.badge-danger  { background: color-mix(in srgb, var(--danger-500) 15%, transparent); color: var(--danger-600); border-color: transparent; }
.badge-info    { background: color-mix(in srgb, var(--info-500) 15%, transparent); color: #0369a1; border-color: transparent; }
[data-theme="dark"] .badge-warn { color: #fbbf24; }
[data-theme="dark"] .badge-brand { color: var(--brand-300); }
[data-theme="dark"] .badge-info { color: #7dd3fc; }
.pill-row { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- avatars ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  color: #fff; font-weight: 700; font-size: .9rem; flex: none;
  overflow: hidden; text-transform: uppercase;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: .72rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.35rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 2rem; }

/* ---------- layout helpers ---------- */
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); }
.grid-auto-lg { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.split { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; align-items: center; gap: .6rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.small { font-size: .84rem; }
.tiny { font-size: .76rem; }
.strong { font-weight: 700; }
.mono { font-family: var(--mono); }
.right { margin-left: auto; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.hide { display: none !important; }

/* ---------- stats ---------- */
.stat-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1rem 1.1rem; box-shadow: var(--shadow-xs);
}
.stat-label { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); font-weight: 700; }
.stat-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; margin-top: .3rem; }
.stat-hint { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }
.stat-accent { position: absolute; }
.stat { position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--brand-500); }
.stat.green::after { background: var(--accent-500); }
.stat.amber::after { background: var(--warn-500); }
.stat.red::after   { background: var(--danger-500); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { background: var(--surface-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-subtle); font-weight: 700; white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- job / talent cards ---------- */
.job-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.05rem 1.15rem; color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.job-card:hover { text-decoration: none; border-color: var(--brand-300); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.job-card h3 { margin: 0 0 .35rem; font-size: 1.02rem; }
.job-card .meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .82rem; color: var(--text-muted); }
.job-card .budget { color: var(--accent-600); font-weight: 700; }
[data-theme="dark"] .job-card .budget { color: var(--accent-400); }

.talent-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.1rem; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .12s;
  display: flex; flex-direction: column; gap: .7rem;
}
.talent-card:hover { text-decoration: none; border-color: var(--brand-300); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.rating { display: inline-flex; align-items: center; gap: .28rem; color: var(--warn-500); font-weight: 700; font-size: .86rem; }
.rating .star { font-style: normal; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1000px 420px at 12% -10%, color-mix(in srgb, var(--brand-500) 26%, transparent), transparent 62%),
    radial-gradient(760px 380px at 92% 6%, color-mix(in srgb, var(--accent-500) 20%, transparent), transparent 60%),
    var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.hero-inner { padding: clamp(2.6rem, 5vw, 5rem) 0 clamp(2.2rem, 4vw, 3.6rem); max-width: 760px; }
.hero h1 { margin-bottom: .8rem; }
.hero .lede { font-size: clamp(1rem, .95rem + .35vw, 1.16rem); color: var(--text-muted); max-width: 60ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1rem;
  padding: .3rem .75rem; border-radius: var(--radius-full);
  background: var(--brand-50); color: var(--brand-700);
  font-size: .78rem; font-weight: 700; letter-spacing: .02em;
}
[data-theme="dark"] .eyebrow { background: color-mix(in srgb, var(--brand-500) 20%, transparent); color: var(--brand-300); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2.2rem; margin-top: 2.4rem; }
.hero-stat .n { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.hero-stat .l { font-size: .82rem; color: var(--text-muted); }

.section { padding: clamp(2.2rem, 4vw, 3.6rem) 0; }
.section-head { margin-bottom: 1.5rem; }
.section-head p { color: var(--text-muted); margin: .35rem 0 0; max-width: 70ch; }

.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.3rem; height: 100%;
}
.feature-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-600); font-size: 1.2rem; margin-bottom: .8rem;
}
[data-theme="dark"] .feature-icon { background: color-mix(in srgb, var(--brand-500) 20%, transparent); color: var(--brand-300); }

.step { display: flex; gap: 1rem; }
.step-num {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-600); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: .9rem;
}

/* ---------- tabs ---------- */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); margin-bottom: 1.3rem; overflow-x: auto; }
.tab {
  padding: .6rem .95rem; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: .92rem; font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-600); border-bottom-color: var(--brand-600); }

/* ---------- sidebar (panel layout) ---------- */
.side-nav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: .5rem; position: sticky; top: calc(var(--header-h) + 1rem); }
.side-nav .icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; flex: none; }
.side-nav .icon svg { width: 17px; height: 17px; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  padding: .55rem .7rem; border-radius: var(--radius-sm); border: 0; background: none;
  color: var(--text-muted); font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer;
}
.side-nav a:hover, .side-nav button:hover { background: var(--bg-subtle); color: var(--text); text-decoration: none; }
.side-nav a.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
[data-theme="dark"] .side-nav a.active { background: color-mix(in srgb, var(--brand-500) 18%, transparent); color: var(--brand-300); }
.side-nav .group-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-subtle); font-weight: 700; padding: .8rem .7rem .3rem; }
.side-nav .badge-count { margin-left: auto; }

/* ---------- filters ---------- */
.filters { display: grid; gap: .9rem; grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: end; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } }

/* ---------- pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: .35rem; margin-top: 1.6rem; flex-wrap: wrap; }
.pagination button {
  min-width: 36px; height: 36px; padding: 0 .5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  font: inherit; font-size: .88rem; cursor: pointer;
}
.pagination button:hover:not(:disabled) { border-color: var(--brand-400); color: var(--brand-600); }
.pagination button.active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; font-weight: 700; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 1.2rem; background: rgba(10, 13, 22, .55); backdrop-filter: blur(3px); }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); width: min(620px, 100%); max-height: 88vh; display: flex; flex-direction: column;
}
.modal-wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.05rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 1.25rem; overflow-y: auto; }
.modal-foot { padding: .95rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .6rem; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.close-x { border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 1.4rem; line-height: 1; padding: .2rem .4rem; border-radius: var(--radius-sm); }
.close-x:hover { background: var(--bg-subtle); color: var(--text); }

/* ---------- toast ---------- */
.toast-stack { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 200; display: flex; flex-direction: column; gap: .55rem; max-width: min(380px, calc(100vw - 2rem)); }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand-500);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: .75rem .95rem;
  font-size: .9rem; animation: toast-in .18s ease-out;
}
.toast.success { border-left-color: var(--accent-500); }
.toast.error   { border-left-color: var(--danger-500); }
.toast.warning { border-left-color: var(--warn-500); }
.toast-title { font-weight: 700; margin-bottom: .15rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-icon { font-size: 2.4rem; margin-bottom: .6rem; opacity: .55; }
.skeleton { background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-inset) 37%, var(--bg-subtle) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem;
  border-radius: var(--radius-full); background: var(--bg-subtle); color: var(--text-muted);
  font-size: .78rem; font-weight: 600; border: 1px solid var(--border);
}
.chip-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; font: inherit; }
.stars { color: var(--warn-500); letter-spacing: .06em; }
.progress { height: 6px; border-radius: var(--radius-full); background: var(--bg-inset); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand-500); border-radius: inherit; }
.progress.green > span { background: var(--accent-500); }

.chat-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; align-items: start; }
.conv-item { display: block; padding: .7rem .8rem; border-radius: var(--radius-sm); color: var(--text); }
.conv-item:hover { background: var(--bg-subtle); text-decoration: none; }
.conv-item.active { background: var(--brand-50); }
[data-theme="dark"] .conv-item.active { background: color-mix(in srgb, var(--brand-500) 18%, transparent); }
.chat-messages { display: flex; flex-direction: column; gap: .7rem; max-height: 52vh; overflow-y: auto; padding: .4rem; }
.bubble { max-width: 76%; padding: .6rem .8rem; border-radius: var(--radius-md); font-size: .92rem; }
.bubble.me { align-self: flex-end; background: var(--brand-600); color: #fff; border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; background: var(--bg-subtle); border-bottom-left-radius: 4px; }
.bubble time { display: block; font-size: .7rem; opacity: .7; margin-top: .2rem; }

.site-footer { background: var(--bg-elevated); border-top: 1px solid var(--border); padding: 2.4rem 0 1.6rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem; }
.footer-grid h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); margin-bottom: .7rem; }
.footer-grid a { display: block; color: var(--text-muted); font-size: .9rem; padding: .18rem 0; }
.footer-grid a:hover { color: var(--brand-600); }
.footer-bottom { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .84rem; color: var(--text-subtle); }

.auth-wrap { display: grid; place-items: center; min-height: calc(100vh - var(--header-h) - 120px); padding: 2rem 0; }
.auth-card { width: min(460px, 100%); }
.auth-tabs { display: flex; gap: .25rem; background: var(--bg-subtle); padding: .25rem; border-radius: var(--radius-sm); margin-bottom: 1.2rem; }
.auth-tabs button { flex: 1; padding: .5rem; border: 0; border-radius: 6px; background: none; font: inherit; font-size: .9rem; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.auth-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

.breadcrumb { display: flex; gap: .4rem; align-items: center; font-size: .85rem; color: var(--text-subtle); margin-bottom: 1rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }

.timeline { position: relative; padding-left: 1.4rem; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 1.1rem; }
.timeline-item::before { content: ""; position: absolute; left: -1.4rem; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-500); border: 2px solid var(--surface); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; overflow-x: auto; gap: .2rem; }
  .side-nav .group-label { display: none; }
  .side-nav a, .side-nav button { white-space: nowrap; width: auto; }
  .chat-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
/* Below 900px the primary navigation moves into the mobile menu: keeping it in
   the header pushed the account buttons past the right edge, and every page
   scrolled sideways. */
@media (max-width: 767px) {
  /* Phones and small tablets collapse the menu; a 768px tablet keeps the
     full navigation. */
  .main-nav { display: none; }
}
@media (max-width: 900px) {
  .header-inner { gap: .4rem; }
  .brand { min-width: 0; }
  .brand-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .98rem; }
  .header-actions { min-width: 0; }
  /* Keep the account labels — hiding them left two empty buttons. */
  .auth-buttons .btn { font-size: .82rem; padding: .34rem .55rem; }
  /* A 768px tablet shows the full navigation, so the links get tighter
     rather than the whole menu collapsing. */
  .main-nav { gap: .1rem; }
  .main-nav a { font-size: .86rem; padding: .3rem .42rem; }
}
@media (max-width: 400px) {
  .auth-buttons .btn { font-size: .72rem; padding: .3rem .38rem; letter-spacing: -.01em; }
  .auth-buttons { gap: .3rem; }
}
@media (max-width: 340px) {
  /* 320px-class phones: the language toggle moves out of the header row. The
     language is still switchable from the account settings and ?lang=. */
  #lang-toggle { display: none; }
  .auth-buttons .btn { font-size: .68rem; padding: .28rem .34rem; }
}
@media (max-width: 480px) {
  /* Narrow phones: the wordmark is dropped for the mark alone so every
     control still fits on one line without scrolling sideways. The link
     keeps its aria-label, and the name is in the document title. */
  .brand-text { display: none; }
  .header-inner { gap: .3rem; }
  .icon-btn { width: 34px; height: 34px; }
  .auth-buttons .btn { font-size: .78rem; padding: .32rem .5rem; }
}
@media (max-width: 480px) {
  /* The container is width:100% plus padding — narrowing the width instead
     of the padding pushes the total past 100% and the page scrolls sideways. */
  .container { padding: 0 .75rem; }
  .header-inner { gap: .3rem; }
  .brand-text { font-size: .92rem; }
}
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.3rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
}
@media (min-width: 768px) { .menu-toggle-wrap { display: none; } }

.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg-elevated);
  padding: 1.2rem 1.25rem; z-index: 55; overflow-y: auto;
}
.mobile-nav a { display: block; padding: .75rem 0; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 500; }

/* ---------------- branding + GDPR cookie banner ---------------- */

.brand-logo { max-height: 34px; width: auto; display: block; }

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}

.cookie-banner .row { gap: 8px; }

@media (max-width: 640px) {
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; }
}

/* ---------------------------------------------------------------------------
   Utility classes

   One-off layout values that used to be inline `style` attributes on the
   elements built in JavaScript. Keeping them here means all the styling
   lives in one stylesheet, which is what the marketplace item review
   expects of an item. A value that changes per element — a progress
   width, a rating colour — stays inline, because it cannot be a static
   class.
   --------------------------------------------------------------------------- */

.u-background-var-bg-elevated-border-block-1px-solid-var-border { background:var(--bg-elevated);border-block:1px solid var(--border); }
.u-color-inherit { color:inherit; }
.u-display-webkit-box-webkit-line-clamp-2-webkit-box-orient-vertical-overflow-hidden { display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
.u-flex-1-max-width-420px { flex:1;max-width:420px; }
.u-font-size-1-05rem { font-size:1.05rem; }
.u-font-size-1-1rem { font-size:1.1rem; }
.u-font-size-1-5rem { font-size:1.5rem; }
.u-font-size-1-6rem { font-size:1.6rem; }
.u-font-size-1-7rem { font-size:1.7rem; }
.u-font-weight-800-font-size-1-05rem { font-weight:800;font-size:1.05rem; }
.u-gap-3rem { gap:.3rem; }
.u-height-72px { height:72px; }
.u-margin-0-width-32px-height-32px-font-size-1rem { margin:0;width:32px;height:32px;font-size:1rem; }
.u-max-height-60vh-overflow-y-auto { max-height:60vh;overflow-y:auto; }
.u-max-width-100 { max-width:100%; }
.u-max-width-130px { max-width:130px; }
.u-max-width-160px { max-width:160px; }
.u-max-width-170px { max-width:170px; }
.u-max-width-180px { max-width:180px; }
.u-max-width-200px { max-width:200px; }
.u-max-width-220px { max-width:220px; }
.u-max-width-280px { max-width:280px; }
.u-max-width-340px { max-width:340px; }
.u-max-width-34ch { max-width:34ch; }
.u-max-width-460px { max-width:460px; }
.u-max-width-60ch { max-width:60ch; }
.u-max-width-62ch { max-width:62ch; }
.u-max-width-760px { max-width:760px; }
.u-max-width-820px { max-width:820px; }
.u-max-width-860px { max-width:860px; }
.u-max-width-960px { max-width:960px; }
.u-min-width-0 { min-width:0; }
.u-padding-0-2rem { padding:0 .2rem; }
.u-white-space-pre-wrap { white-space:pre-wrap; }
.u-white-space-pre-wrap-line-height-1-75 { white-space:pre-wrap;line-height:1.75; }
.u-width-160px { width:160px; }
