/* Bountink styles: design tokens and components. */

@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/satoshi-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-primary: #6c3ce9;
  --color-primary-hover: #5b2fd6;
  --color-on-primary: #ffffff;
  --color-secondary: #9e70ff;
  --color-accent: #16a34a;
  --color-background: #f7f7f8;
  --color-card: #ffffff;
  --color-border: #e7e7ea;
  --color-ring: #6c3ce9;
  --bg: var(--color-background);
  --grain-image: url("../img/grain-light.png");
  --grant-card-bg: #ffffff;
  --nav-grants-bg: #e8e8eb;
  --nav-grants-bg-hover: #dedee3;
  --surface: var(--color-card);
  --surface-2: #f4f4f5;
  --nav-bg: rgba(255, 255, 255, .88);
  --ink: #131316;
  --ink-soft: #3f3f46;
  --ink-faint: #63636e;
  --line: var(--color-border);
  --line-strong: #d6d6db;
  --accent-soft: #f1ebff;
  --accent-ink: #5b2fd6;
  --accent-border: #e2d7ff;
  --green: #0e7a3d;
  --green-fill: var(--color-accent);
  --green-soft: #e5f4eb;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --btn-height: 36px;
  --btn-font-size: 14px;
  --btn-pad-x: 12px;
  --btn-pad-y: 8px;
  --btn-radius: 10px;
  --btn-line-height: 20px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 40px; --space-8: 48px;
  --shadow-sm: 0 1px 2px rgba(20, 16, 40, .05);
  --shadow-md: 0 1px 2px rgba(20, 16, 40, .05), 0 12px 32px -12px rgba(20, 16, 40, .14);
  --shadow-lg: 0 24px 64px -16px rgba(20, 16, 40, .28);
  --font-display: "Satoshi", system-ui, -apple-system, sans-serif;
  --font-body: "Satoshi", system-ui, -apple-system, sans-serif;
  --font-mono: "Satoshi", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --color-primary: #9e70ff;
  --color-primary-hover: #ab87ff;
  --color-on-primary: #21143f;
  --color-background: #0d0d10;
  --color-card: #16161a;
  --color-border: #26262c;
  --color-ring: #9e70ff;
  --bg: #0d0d10;
  --grain-image: url("../img/grain-dark.png");
  --grant-card-bg: #16161a;
  --nav-grants-bg: #26262c;
  --nav-grants-bg-hover: #2f2f37;
  --surface: #16161a;
  --surface-2: #1e1e23;
  --nav-bg: rgba(13, 13, 16, .88);
  --ink: #f4f4f5;
  --ink-soft: #d4d4d8;
  --ink-faint: #a6a6b0;
  --line: #26262c;
  --line-strong: #3a3a42;
  --accent-soft: #251d45;
  --accent-ink: #c9b8ff;
  --accent-border: #382a66;
  --green: #6fd598;
  --green-soft: #14301f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px -12px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
:root[data-theme="dark"] .status-chip.review { color: #f3cd8a; background: #3a2c10; }
:root[data-theme="dark"] .lb-rank.p2 { background: #2c2c33; }
:root[data-theme="dark"] .warn-box { border-color: #5c4a1c; background: #2e2712; }
:root[data-theme="dark"] .krak-line .krak-missing { color: #f3cd8a; }
:root[data-theme="dark"] .toast { background: #f4f4f5; color: #17171c; }
:root[data-theme="light"] .status-chip.review { color: #92600a; background: #fdf0d5; }
:root[data-theme="light"] .lb-rank.p2 { background: #e7e7ea; }
:root[data-theme="light"] .warn-box { border-color: #e8cf8f; background: #fdf6e0; }
:root[data-theme="light"] .krak-line .krak-missing { color: #92600a; }
:root[data-theme="light"] .toast { background: #17171c; color: #f4f4f5; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background-color: var(--bg); background-image: var(--grain-image); background-size: 240px 240px; background-repeat: repeat; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--grain-image);
  background-size: 240px 240px;
  background-repeat: repeat;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
main { flex: 1 0 auto; }
button, [role="button"], summary { min-height: var(--btn-height); }
select, input:not([type="checkbox"], [type="radio"]), textarea { min-height: 2.75rem; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent-ink); }
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
  border-radius: 6px;
}
h1, h2, .display { font-family: var(--font-display); letter-spacing: -0.02em; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
main.wrap { width: 100%; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* Header: light SaaS bar, blurred, hairline border */
.nav { background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--ink); position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 10px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 800; font-size: 16.5px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 8px; overflow: hidden; background: #000; }
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand .ink-part { color: var(--color-secondary); }
.brand-domain { color: var(--ink-faint); font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.brand-tag { color: var(--ink-faint); font-size: 13px; font-weight: 500; margin-left: 4px; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.btn {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: var(--btn-radius); min-height: var(--btn-height); padding: var(--btn-pad-y) var(--btn-pad-x); font-size: var(--btn-font-size); font-weight: 600; line-height: var(--btn-line-height);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap; text-decoration: none;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active { background: var(--surface-2); }
.btn-purple, .btn-primary { background: var(--color-primary); border-color: transparent; color: var(--color-on-primary); font-weight: 600; }
.btn-purple:hover, .btn-primary:hover { background: var(--color-primary-hover); border-color: transparent; color: var(--color-on-primary); }
.btn-danger { background: #b42318; border-color: transparent; color: #fff; font-weight: 600; }
.btn-danger:hover { background: #912018; border-color: transparent; color: #fff; }
.btn-ghost-light { background: transparent; border-color: transparent; color: var(--ink-soft); box-shadow: none; }
.btn-ghost-light:hover { background: var(--surface-2); border-color: transparent; color: var(--ink); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.who-chip {
  display: none; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; min-height: 40px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink);
  font-family: inherit; cursor: pointer;
  transition: opacity .18s ease;
}
.who-chip.on { display: inline-flex; }
.who-chip:hover { background: transparent; color: var(--ink); opacity: .85; }
.who-avatar {
  flex: none; width: 40px; height: 40px; border: 0; box-shadow: none; border-radius: 50%; overflow: hidden;
  background: var(--accent-soft); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
}
.who-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-grants-group { display: inline-flex; align-items: center; gap: 6px; flex: none; }
@media (max-width: 900px) { .nav-grants-group { display: none; } }
@media (max-width: 760px) { .brand-tag { display: none; } }
@media (max-width: 900px) { #sponsorBtn.nav-sponsor { display: none; } }
@media (max-width: 520px) { .brand-domain { display: none; } .brand { font-size: 16px; } }

/* Sponsor banner, lavender lock, soft SaaS panel */
.banner {
  margin-top: 12px; position: relative; overflow: hidden; border-radius: var(--radius-lg);
  border: 1px solid #e2d7ff;
  background: linear-gradient(120deg, #f4efff 0%, #ece1ff 58%, #e2d2ff 100%); color: #251c42;
}
.banner-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center; display: block;
  opacity: 0; transition: opacity .4s ease; pointer-events: none;
}
.banner-slide.has-img .banner-bg { opacity: 1; }
.banner-dots { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 2; display: flex; gap: 2px; pointer-events: none; }
.banner-dots:empty { display: none; }
/* Visual indicator stays small; the button itself is a 28px touch target */
.banner-dot { width: 28px; height: 28px; min-height: 28px; border-radius: 50%; border: 0; padding: 0; background: transparent; cursor: pointer; position: relative; pointer-events: auto; }
.banner-dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: var(--radius-pill); transform: translate(-50%, -50%); background: rgba(37, 28, 66, .35); transition: background .18s ease, width .18s ease; }
.banner-dot.on::after { background: #251c42; width: 22px; }
.banner-dot:focus-visible { outline-color: #251c42; }
.banner-slide { display: none; position: relative; z-index: 1; aspect-ratio: 1214 / 216.39; }
.banner-slide.on { display: block; }
.banner-hit { position: absolute; inset: 0; display: block; z-index: 1; }
.banner-cta { position: absolute; left: 22px; bottom: 22px; z-index: 3; pointer-events: auto; box-shadow: 0 2px 10px rgba(23, 18, 33, .25); }
.btn-dark { background: #171221; color: #fff; border: 1px solid #171221; border-radius: var(--btn-radius); padding: var(--btn-pad-y) var(--btn-pad-x); font-size: var(--btn-font-size); font-weight: 600; line-height: var(--btn-line-height); min-height: var(--btn-height); cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: background .18s ease; }
.btn-dark:hover { background: #2c2145; }
@media (max-width: 760px) {
  .banner-slide { aspect-ratio: 356 / 311; }
  .banner-cta { left: 14px; bottom: 14px; min-height: 32px; padding: 6px 12px; font-size: 13px; }
}

/* User card above Recent Activity: banner lavender, fixed in both schemes */
.user-card {
  background: linear-gradient(120deg, #f4efff 0%, #ece1ff 58%, #e2d2ff 100%);
  border: 1px solid #e2d7ff; border-radius: var(--radius); padding: 14px; margin-bottom: 12px; color: #251c42;
}
.uc-top { display: flex; align-items: center; gap: 12px; }
.uc-avatar { flex: none; width: 40px; height: 40px; border: 0; box-shadow: none; border-radius: 50%; background: #ffffff; color: #251c42; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; overflow: hidden; }
.uc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uc-id { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.uc-name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #000000; }
.uc-sub { color: #554a77; font-size: 13px; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-reward { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 9px 12px; background: rgba(255, 255, 255, .68); border-radius: 12px; }
.uc-label { color: #554a77; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.uc-total { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; color: #000000; white-space: nowrap; }
.uc-total small { font-size: 1em; color: #554a77; font-weight: 600; font-family: var(--font-mono); }
.uc-link {
  width: 100%; background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 10px;
  display: block; text-decoration: none;
}
.uc-link:hover .uc-name { color: #000000; text-decoration: underline; }
.uc-chev { margin-left: auto; flex: none; color: #554a77; font-size: 16px; line-height: 1; }

/* Main layout: heading over a two column board */
.board {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--space-7); align-items: stretch; padding: 0 0 132px;
}
.board-main { min-width: 0; align-self: stretch; }
#listView > .sec-head { margin-top: 18px; }
@media (min-width: 921px) {
  #listView > .sec-head { width: calc(100% - 400px); }
}
@media (max-width: 920px) { .board { grid-template-columns: 1fr; } }
.rail-col {
  align-self: start; min-width: 0;
  overflow: visible;
  padding: 0 0 8px;
}
@media (min-width: 921px) {
  .rail-col { position: sticky; top: 74px; }
  /* The 132px of space over the footer lives on the board itself. */
  .board { padding-bottom: 132px; }
  .board-main { padding-bottom: 0; }
  .board .rail-col { padding-bottom: 0; }
}
.rail-col > .user-card { position: static; }
.rail-stack { position: static; width: 100%; }
@media (max-width: 920px) {
  .rail-col { padding: 0; }
  /* On mobile the user card is not shown at all. */
  .rail-col .user-card { display: none; }
}
.rail-col .feed-card, .rail-col .feed-list, .rail-col .user-card { max-height: none; overflow: hidden; }
.rail-col .feed-list { overflow: visible; height: auto; }
.rail-col .feed-card { height: auto; }
.rail-col .feed-head { padding: 10px 14px; }
.rail-col .feed-item { padding: 8px 14px; height: auto; min-height: 0; }
.rail-col .rail-activity .feed-item { min-height: 74px; align-items: center; }
.rail-col .rail-activity .feed-item p { min-height: 0; }
.rail-col .rail-activity .feed-item .when { padding-top: 0; }
.rail-col .feed-foot { padding: 6px; }
.rail-col .bm-item { padding-top: 4px; padding-bottom: 4px; min-height: 74px; }
.rail-col .feed-head.rail-tabs { padding: 8px; gap: 6px; }
.rail-col .rail-tab { flex: 1 1 0; justify-content: center; }
.rail-col .bm-item { padding-left: 14px; padding-right: 4px; }
.rail-col .bm-remove { width: 32px; margin-right: 2px; }

#sponsorView .sec-head { max-width: 760px; margin-left: auto; margin-right: auto; }
#sponsorView .panel { margin-left: auto; margin-right: auto; }
/* The same space over the footer as the bounty board carries. */
#sponsorView { padding-bottom: 132px; }
@media (max-width: 640px) { #sponsorView { padding-bottom: 116px; } }
#activityView .sec-head, #leaderboardView .sec-head { max-width: 760px; margin-left: auto; margin-right: auto; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.sec-head h1, .sec-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.sec-head .note { color: var(--ink-faint); font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }
#liveCount { text-transform: uppercase; font-weight: 500; }

/* Search and filters toolbar, pinned under the header */
.toolbar {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 12px;
  position: sticky; top: 64px; z-index: 30;
  background-color: var(--bg); background-image: var(--grain-image); background-size: 240px 240px; background-repeat: repeat; padding: 10px 0 8px; margin-top: -10px;
}
.toolbar .search-box { width: 100%; margin-bottom: 0; }
.toolbar .filters { margin-bottom: 0; align-self: flex-start; max-width: 100%; }
.search-box { position: relative; margin-bottom: 14px; }
.search-box svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ink-faint); pointer-events: none; }
.search-box input {
  width: 100%; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15px; padding: 11px 16px 11px 48px; min-height: 3rem;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search-box input::placeholder { color: var(--ink-faint); }
.search-box input:focus { border-color: var(--color-secondary); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }

.filters {
  display: inline-flex; gap: 2px; flex-wrap: wrap; margin-bottom: 22px;
  background: var(--surface-2); border-radius: 14px; padding: 4px;
}
.pill {
  border: 0; background: transparent; color: var(--ink-soft);
  border-radius: var(--btn-radius); padding: var(--btn-pad-y) var(--btn-pad-x); font-size: var(--btn-font-size); font-weight: 600; line-height: var(--btn-line-height); min-height: var(--btn-height); display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.pill:hover { color: var(--ink); }
.pill.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.filter-group { display: contents; }
@media (max-width: 640px) {
  .filters { flex-direction: column; align-items: flex-start; gap: 6px; background: transparent; padding: 0; border-radius: 0; }
  .filter-group { display: inline-flex; gap: 2px; flex-wrap: wrap; max-width: 100%; background: var(--surface-2); border-radius: 14px; padding: 4px; }
}

/* Bounty cards */
.bounty-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
@media (max-width: 640px) { .bounty-list { grid-template-columns: 1fr; } }
.bticket {
  display: flex; flex-direction: column; width: 100%; height: 100%; text-align: left; color: var(--ink); padding: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; font-size: 13.3333px; line-height: normal; cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.bticket:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.bticket:active { transform: none; box-shadow: var(--shadow-sm); }
.bt-main { flex: 1; min-width: 0; padding: 14px 18px 12px; display: flex; flex-direction: column; }
.bt-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; min-width: 0; }
.bt-sponsor { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-weight: 700; font-size: 13.5px; }
.bt-sponsor-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-cat {
  flex: none; margin-left: auto; font-size: 11.5px; font-weight: 700;
  color: var(--accent-ink); background: var(--accent-soft); border-radius: var(--radius-pill); padding: 3px 10px;
}
.detail-cat { align-self: flex-start; }
.kv dd.sponsor-cell { display: flex; align-items: center; gap: 8px; }
.kv dd.sponsor-cell > span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.kv dd.sponsor-cell .sponsor-logo.xs { margin-right: 0; vertical-align: baseline; }
.kv dd.has-tx { flex-wrap: wrap; }
.kv dd .tx-links { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; }
.kv dd .tx { font-weight: 700; text-decoration: none; }
.kv dd .tx:hover { text-decoration: underline; }
.bt-title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.4;
  min-height: calc(15px * 1.4 * 2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bt-meta { display: flex; flex-wrap: wrap; gap: 5px 16px; margin-top: 7px; color: var(--ink-faint); font-size: 12.5px; }
.bt-meta b { color: var(--ink-soft); font-weight: 700; }
.bt-stub {
  flex: none; border-top: 1px solid var(--line);
  padding: 10px 18px 12px; display: flex; flex-direction: row; align-items: center; gap: 12px;
}
.bt-reward-group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bt-reward-label { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); }
.bt-reward { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; color: var(--ink); white-space: nowrap; }
.bt-reward small { font-size: 1em; font-weight: 600; color: var(--ink); }
.bt-status { margin-left: auto; }
.status-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  color: var(--green); background: var(--green-soft); border-radius: var(--radius-pill); padding: 3px 10px;
}
.status-chip.review { color: #92600a; background: #fdf0d5; }
/* Payment method label: detail pages only, full width of the reward panel. */
.pay-chip {
  display: flex; align-items: center; justify-content: center; width: 100%; text-align: center; white-space: nowrap;
  font-size: var(--btn-font-size); font-weight: 600; letter-spacing: .01em; line-height: var(--btn-line-height);
  min-height: var(--btn-height);
  border: 1px solid transparent; border-radius: var(--btn-radius); padding: var(--btn-pad-y) var(--btn-pad-x);
  color: var(--green); background: var(--green-soft);
}
.kv dd .pay-chip { vertical-align: 1px; }

/* Grants market */
.grant-filters { display: inline-flex; gap: 2px; flex-wrap: wrap; background: var(--surface-2); border-radius: 14px; padding: 4px; }
#grantsView .sec-head { align-items: center; }
.grant-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.grant-list .bticket { height: auto; }
.grant-list .bt-main { flex: none; }
.grant-list .bt-title { min-height: 0; }
.grant-list .bt-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 8px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; font-weight: 500;
}
.grant-list .bticket {
  background-color: var(--grant-card-bg);
  background-image: var(--grain-image);
  background-size: 240px 240px;
  background-repeat: repeat;
}
.grant-list .bticket .bt-stub {
  background-color: rgba(100, 100, 115, .07);
  background-image: var(--grain-image);
  background-size: 240px 240px;
  background-repeat: repeat;
}
.detail-head.is-grant {
  background-color: var(--grant-card-bg);
  background-image: var(--grain-image);
  background-size: 240px 240px;
  background-repeat: repeat;
}

/* Fine grain for a grant header colour chosen in the admin Settings. */
.detail-head.is-grant.grain-fine,
.grain-fine-preview {
  background-image:
    url("../img/grain-fine-white.svg"),
    url("../img/grain-fine-black.svg");
  background-size: 160px 160px, 160px 160px;
  background-repeat: repeat, repeat;
}

.grain-fine-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
}
@media (max-width: 1024px) { .grant-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grant-list { grid-template-columns: 1fr; } }
.grant-cover {
  position: relative; flex: none; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  background: linear-gradient(120deg, #f4efff 0%, #e2d2ff 100%);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.grant-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; opacity: 0; transition: opacity .4s ease;
}
.grant-cover img.loaded { opacity: 1; }
.grant-cover .sponsor-logo { position: relative; z-index: 0; box-shadow: var(--shadow-sm); }
.grant-apply {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--color-primary); color: var(--color-on-primary);
  border-radius: var(--btn-radius); min-height: var(--btn-height); padding: var(--btn-pad-y) var(--btn-pad-x);
  font-size: var(--btn-font-size); font-weight: 600; line-height: var(--btn-line-height); letter-spacing: .01em; white-space: nowrap;
  transition: background .18s ease;
}
.bticket:hover .grant-apply { background: var(--color-primary-hover); }
.grant-cover .sponsor-logo.lg { width: 64px; height: 64px; border-radius: 16px; }
.grant-cover .sponsor-logo.lg .logo-initial { font-size: 29px; }
.empty-note { grid-column: 1 / -1; text-align: center; color: var(--ink-faint); padding: 32px 20px; font-size: 13.5px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-note .empty-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.empty-note .empty-sub { margin: 6px 0 0; }

/* Sponsor and project logos */
.sponsor-logo { flex: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.sponsor-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sponsor-logo svg { display: block; width: 66%; height: 66%; }
.sponsor-logo .logo-initial { color: #fff; font-weight: 800; line-height: 1; }
.sponsor-logo.sm { width: 30px; height: 30px; border-radius: 9px; }
.sponsor-logo.sm .logo-initial { font-size: 13px; }
.sponsor-logo.lg { width: 48px; height: 48px; border-radius: 13px; }
.sponsor-logo.lg .logo-initial { font-size: 22px; }
.sponsor-logo.xs { width: 21px; height: 21px; border-radius: 6px; vertical-align: -6px; margin-right: 7px; }
.sponsor-logo.xs .logo-initial { font-size: 11px; }
.sponsor-logo.is-avatar { border-radius: 50%; }
.sponsor-logo.is-avatar.sm .logo-initial { font-size: 11px; }
.sponsor-logo.is-avatar.lg .logo-initial { font-size: 19px; }
.sponsor-logo.is-avatar.xs .logo-initial { font-size: 9px; }
.sponsor-type-chip {
  display: inline-flex; align-items: center; flex: none; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: .01em;
  color: var(--ink-soft); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 2px 8px; margin-left: 7px; vertical-align: 2px;
}
.kv dd.sponsor-cell .sponsor-type-chip { margin-left: 0; vertical-align: baseline; }

/* Verified badge: small blue disc, white check */
.verified-badge { flex: none; display: inline-block; width: 15px; height: 15px; margin-left: 5px; vertical-align: -2px; }
.verified-badge svg { display: block; width: 100%; height: 100%; }
.bt-sponsor .verified-badge { margin-left: 0; vertical-align: baseline; }
.who-link .verified-badge { margin-left: 4px; vertical-align: -2px; }
.lb-name .verified-badge, .profile-name .verified-badge, .uc-name .verified-badge { margin-left: 5px; }
.badge-check { vertical-align: -2px; }

/* Reward panel: soft lavender, not a dark block */
.reward-big { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }
.reward-big small { font-size: 12px; font-weight: 600; color: var(--ink); font-family: var(--font-mono); }
.panel-dark { background: var(--accent-soft); border-color: var(--accent-border); color: var(--ink); }
.panel-dark h3 { color: var(--ink); }
.panel-dark .reward-big { color: var(--ink); }
.panel-dark .reward-big small { color: var(--ink); }
.panel-dark .fine { color: var(--ink-soft); }
.prize-list { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--accent-border); }
.prize-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--accent-border); font-size: 13.5px; }
.prize-row .place { color: var(--ink-soft); font-weight: 600; }
.prize-row .amount { font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.prize-row .amount small { font-size: 1em; font-weight: 600; color: var(--accent-ink); font-family: var(--font-mono); }
.prize-more {
  margin-top: 6px; background: none; border: 0; padding: 4px 0; min-height: var(--btn-height);
  color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.prize-more:hover { text-decoration: underline; }

/* Recent Activity feed */
.feed-block + .feed-block { margin-top: 12px; }
.feed-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feed-head { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.feed-head h2 { margin: 0; font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.feed-head.rail-tabs { justify-content: flex-start; gap: 4px; }
.rail-tab {
  border: 0; background: transparent; color: var(--ink-faint);
  border-radius: var(--btn-radius); padding: 6px 10px; min-height: 36px;
  font: inherit; font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.rail-tab:hover { color: var(--ink); }
.rail-tab.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.rail-tab .feed-note { background: var(--surface); }
.rail-tab-sep { display: none; flex: none; align-items: center; color: var(--ink-faint); font-size: 13.5px; font-weight: 400; line-height: 1; }
.feed-head.rail-tabs:has(#railTabBookmarks:not([hidden])) .rail-tab-sep { display: inline-flex; }
.feed-head .feed-note { color: var(--ink-faint); background: var(--surface-2); border-radius: var(--radius-pill); padding: 3px 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.feed-list { list-style: none; margin: 0; padding: 0; height: auto; }
.feed-item { display: flex; gap: 10px; padding: 12px 16px; align-items: flex-start; height: auto; min-height: 0; }
.feed-item + .feed-item { border-top: 1px solid var(--line); }
.feed-item p { margin: 0; flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; color: var(--ink-soft); height: auto; min-height: 0; }
.feed-item p b { color: var(--ink); font-weight: 700; }
.feed-item .feed-title { font-weight: 700; color: var(--ink); }
.feed-item .when { flex: none; color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; padding-top: 3px; white-space: nowrap; }
.feed-item .tx { font-weight: 700; text-decoration: none; }
.feed-item .tx:hover { text-decoration: underline; }
.feed-item button.tx { background: none; border: 0; padding: 0; min-height: 0; font: inherit; color: var(--accent-ink); cursor: pointer; }
.feed-empty { padding: 20px 16px; color: var(--ink-faint); font-size: 13px; text-align: center; }
.rail-activity .feed-empty { min-height: 74px; display: flex; align-items: center; justify-content: center; padding: 8px 14px; }
.rail-activity .feed-ghost { border-top: 1px solid var(--line); }
.feed-foot { border-top: 1px solid var(--line); padding: 8px; }
.feed-foot .btn { width: 100%; text-decoration: none; }
.btn.bm-toggle.on { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-ink); }

/* Bookmarks rows in the rail card */
.bm-item { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 16px; }
.bm-item + .bm-item { border-top: 1px solid var(--line); }
.bm-open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 4px 0; text-align: left; color: var(--ink); font: inherit; cursor: pointer; text-decoration: none;
}
.bm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bm-title {
  font-size: 13px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bm-meta { color: var(--ink-faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-remove {
  flex: none; width: 32px; height: 32px; align-self: center; margin-right: 6px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 8px; color: var(--ink-faint); cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
.bm-remove svg { width: 15px; height: 15px; display: block; }
.bm-remove:hover { color: var(--ink); background: var(--surface-2); }
.bm-remove:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; color: var(--ink); }

/* Detail pages */
[hidden] { display: none !important; }
.back-link {
  display: inline-flex; align-items: center; gap: 7px; margin: 26px 0 18px; min-height: var(--btn-height);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--btn-radius);
  padding: var(--btn-pad-y) var(--btn-pad-x); color: var(--ink); font-size: var(--btn-font-size); font-weight: 600; line-height: var(--btn-line-height);
  text-decoration: none; cursor: pointer; font-family: inherit;
  transition: background .18s ease, border-color .18s ease;
}
.back-link:hover { background: var(--surface-2); border-color: var(--line-strong); }
.detail-head {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 22px 24px 18px;
}
.detail-head .sponsor-line { color: var(--ink-faint); font-size: 12.5px; font-weight: 600; margin: 0; }
.detail-head-top { display: flex; gap: 16px; align-items: center; }
.detail-head-text { flex: 1; min-width: 0; }
.detail-title { margin: 0 0 4px; font-size: 23px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
.detail-head .sponsor-logo.lg { width: 51.5px; height: 51.5px; border-radius: 14px; }
.detail-head .sponsor-logo.lg .logo-initial { font-size: 24px; }
.name-link { color: inherit; text-decoration: none; }
.name-link:hover { text-decoration: underline; }
@media (max-width: 640px) { .detail-title { font-size: 19px; } .detail-head { padding: 18px 16px 15px; } }
.detail-reward-row { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-top: 16px; padding: 13px 15px; background: var(--surface-2); border-radius: 14px; }
.detail-reward { font-size: 23px; font-weight: 800; letter-spacing: -0.01em; line-height: 1; color: var(--ink); }
.detail-reward small { font-size: 1em; color: var(--ink); font-weight: 600; font-family: var(--font-mono); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-left: auto; color: var(--ink-faint); font-size: 12.5px; }
.detail-meta b { color: var(--ink); font-weight: 700; }
@media (max-width: 640px) { .detail-meta { margin-left: 0; flex-basis: 100%; } .detail-reward-row .bm-toggle { margin-left: auto; } .detail-head .detail-reward-row { align-items: center; } }
.detail-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px; align-items: start; padding: 24px 0 64px;
}
#activityView .feed-card { max-width: 760px; margin-left: auto; margin-right: auto; }
#activityView .feed-item p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 920px) { .detail-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.panel + .panel { margin-top: 14px; }
.panel h3 { margin: 0 0 9px; font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; }
.panel h4 { margin: 18px 0 7px; font-size: 13.5px; font-weight: 700; }
.panel .prose { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.prose-pre { white-space: pre-line; }
.req { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 13.5px; }
.req li { margin-bottom: 4px; }
.panel .kv { margin: 4px 0 0; grid-template-columns: 1fr; }
.panel label.f:first-of-type { margin-top: 4px; }

/* Sheet (login popup card) */
.sheet {
  background: var(--surface); color: var(--ink); width: 100%; max-width: 620px;
  border: 1px solid var(--line); border-radius: 20px; padding: 26px 26px 32px; position: relative;
  box-shadow: var(--shadow-lg);
}
.sheet h2 { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; line-height: 1.25; margin: 0 42px 7px 0; }
.sheet .lede { color: var(--ink-soft); margin: 0 0 16px; font-size: 13.5px; line-height: 1.55; }
.sheet.auth-sheet { max-width: 432px; padding: 24px 24px 26px; }
.sheet.auth-sheet h2 { margin-bottom: 6px; }
.sheet.auth-sheet .lede { margin-bottom: 14px; }

/* Modal: the login sheet as a popup over a dimmed overlay. */
.overlay {
  position: fixed; inset: 0; z-index: 80; display: none;
  background: rgba(15, 13, 25, .5); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 16px;
}
.overlay.open { display: flex; }
.overlay .sheet { max-height: 92vh; overflow-y: auto; }
/* Sheet close X: a drawn SVG cross in a 36px icon button. */
.sheet-close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; min-height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-faint);
  cursor: pointer; transition: background .18s ease, color .18s ease;
}
.sheet-close svg { width: 17px; height: 17px; display: block; }
.sheet-close:hover { background: var(--surface-2); color: var(--ink); }
.sheet-close:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; color: var(--ink); }
.paid-badge {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--green); background: var(--green-soft); font-size: 12.5px; font-weight: 700;
  border-radius: var(--radius-pill); padding: 3px 11px;
}
/* Live submissions count in the reward panel. */
.panel-dark .sub-count {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--accent-border); font-size: 13px;
}
.panel-dark .sub-count-label { color: var(--ink-soft); font-weight: 600; }
.panel-dark .sub-count-num { font-weight: 800; }
/* The links a participant sent, shown in their Submitted state. */
.submitted-links { margin: 12px 0 0; display: grid; gap: 10px; }
.submitted-links .sl-label { display: block; font-size: 12.5px; font-weight: 700; margin: 0 0 2px; }
.submitted-links a { word-break: break-all; }
/* Entries in the detail page submissions popup. */
.subs-list { margin-top: 4px; }
.sub-entry { padding: 12px 0; border-top: 1px solid var(--line); }
.sub-entry:first-child { border-top: 0; padding-top: 4px; }
.sub-entry-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sub-entry-who { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.sub-entry-handle { color: var(--ink-faint); font-weight: 600; font-size: 13px; }
.sub-entry .when { color: var(--ink-faint); font-size: 11.5px; white-space: nowrap; }
.sub-entry .submitted-links { margin-top: 8px; }
.sub-listing { margin: 8px 0 0; }
.sub-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sub-locked-note { align-self: center; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 16px 0; }
.kv div { background: var(--surface); padding: 11px 14px; }
.kv dt { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 3px; }
.kv dd { margin: 0; font-weight: 600; font-size: 13.5px; }
.kv.profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv.profile-stats dd { white-space: nowrap; }
@media (max-width: 520px) {
  .kv.profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kv.profile-stats div { padding: 10px; }
  .kv.profile-stats dt { font-size: 9.5px; letter-spacing: .04em; }
  .kv.profile-stats dd { font-size: 12.5px; }
}
label.f { display: block; font-size: 12.5px; font-weight: 700; margin: 14px 0 5px; }
.inp, textarea.inp, select.inp {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 14px; padding: 10px 13px; min-height: 2.75rem;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.inp:focus { border-color: var(--color-secondary); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.inp:disabled { background: var(--surface-2); color: var(--ink-faint); cursor: not-allowed; }
textarea.inp { min-height: 82px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.form-row-2 label.f { margin-top: 4px; }
.form-row-2 .inp { min-width: 0; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; } }
.submit-bar { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.fine { color: var(--ink-faint); font-size: 12px; }
.ok-box { display: none; border: 1px solid var(--green); border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-size: 13.5px; background: var(--green-soft); }
.ok-box.show { display: block; }

/* Nav text links */
.nav-link {
  display: inline-flex; align-items: center; min-height: var(--btn-height);
  background: none; border: 0; padding: var(--btn-pad-y) var(--btn-pad-x); cursor: pointer; border-radius: var(--btn-radius);
  color: var(--ink-soft); font: inherit; font-size: var(--btn-font-size); font-weight: 600; line-height: var(--btn-line-height); text-decoration: none; white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.nav-active { color: #9e70ff; font-weight: 700; }
.nav-link.nav-active:hover { color: #9e70ff; background: var(--accent-soft); }
.foot-col a.nav-active { color: #9e70ff; font-weight: 700; }
.nav-link.nav-grants-link {
  background-color: var(--nav-grants-bg);
  background-image: var(--grain-image);
  background-size: 240px 240px;
  background-repeat: repeat;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--ink); font-weight: 700;
}
.nav-link.nav-grants-link:hover { background-color: var(--nav-grants-bg-hover); color: var(--ink); }
.nav-link.nav-grants-link.nav-active { color: var(--accent-ink); border-color: var(--accent-border); }
.nav-link.nav-grants-link.nav-active:hover { color: var(--accent-ink); background-color: var(--nav-grants-bg-hover); }
@media (max-width: 900px) { .nav-extra { display: none; } }

/* Mobile navbar */
.nav-burger {
  display: none; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; min-height: 44px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--surface); color: var(--ink-soft);
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.nav-burger:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
.nav-burger svg { width: 21px; height: 21px; display: block; }
.mobile-menu { display: none; }
@media (max-width: 900px) {
  #sponsorBtn { display: none !important; }
  .nav-burger { display: inline-flex; }
  .mobile-menu.open {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 0 12px; border-top: 1px solid var(--line);
  }
  .mobile-menu .nav-link { display: flex; width: 100%; min-height: 44px; padding: 0 12px; font-size: 14.5px; border-radius: 12px; }
  .mobile-menu .nav-link.nav-grants-link { border-radius: 0; }
  #loginBtn.is-logout { display: none; }
  .mobile-menu .mobile-logout { border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; margin-top: 4px; padding-top: 14px; text-align: left; }
}

/* Leaderboard */
.lb-list { display: flex; flex-direction: column; gap: 8px; max-width: 760px; margin-left: auto; margin-right: auto; }
.lb-row { display: grid; grid-template-columns: 30px 32px minmax(0, 1fr) auto 10px; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 14px; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease; }
.lb-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.lb-row.me { border-color: var(--accent-border); background: var(--accent-soft); }
.lb-rank { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); background: var(--surface-2); }
.lb-rank.p1 { background: #f6c453; color: #4a3200; }
.lb-rank.p2 { background: #e7e7ea; color: var(--ink-soft); }
.lb-rank.p3 { background: #f0d9c4; color: #7a4a21; }
.lb-avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; overflow: hidden; }
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-row.me .lb-avatar { background: var(--surface); }
.lb-id { min-width: 0; display: flex; flex-direction: column; }
.lb-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-you { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); background: var(--surface); border-radius: var(--radius-pill); padding: 2px 9px; vertical-align: 2px; }
.lb-meta { color: var(--ink-faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.placed-label { font-weight: 500; text-transform: uppercase; letter-spacing: .03em; color: var(--ink); white-space: nowrap; }
.lb-total { text-align: right; font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.lb-total small { font-size: 1em; color: var(--ink-faint); font-weight: 600; font-family: var(--font-mono); }
#leaderboardView .sec-head { align-items: center; }
.lb-grand {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  min-height: var(--btn-height); padding: var(--btn-pad-y) var(--btn-pad-x);
  border: 1px solid var(--line-strong); border-radius: var(--btn-radius);
  background: var(--surface); color: var(--ink);
  font-size: var(--btn-font-size); font-weight: 600; line-height: var(--btn-line-height);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.lb-grand b { font-weight: 800; letter-spacing: -0.01em; }
.lb-chev { flex: none; color: var(--ink-faint); font-size: 16px; line-height: 1; }

/* Pager: dots, never numbers */
.pager { display: flex; align-items: center; justify-content: center; text-align: center; gap: 6px; flex-wrap: wrap; margin: 14px auto 56px; max-width: 760px; }
.pager:empty { display: none; }
.pg-btn {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
  border-radius: var(--btn-radius); padding: var(--btn-pad-y) var(--btn-pad-x); font: inherit; font-size: 13.5px; font-weight: 600; line-height: var(--btn-line-height);
  min-height: var(--btn-height); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .18s ease, color .18s ease;
}
.pg-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.pg-btn:disabled { opacity: .45; cursor: default; }
.pg-dots { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: center; }
.pg-dot { width: 36px; height: 36px; min-height: 36px; padding: 0; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.pg-dot-mark { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--line-strong); transition: background .18s ease, width .18s ease; display: block; }
.pg-dot:hover .pg-dot-mark { background: var(--ink-faint); }
.pg-dot.on { cursor: default; }
.pg-dot.on .pg-dot-mark { width: 22px; background: var(--color-primary); }
.pager-bounties { margin: 18px auto 0; max-width: none; }
.pager-bounties:empty { display: none; margin: 0; }
.pager-grants { margin: 18px auto 0; max-width: none; }
.pager-grants:empty { display: none; margin: 0; }

/* Auth: Google only */
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: var(--btn-radius); padding: var(--btn-pad-y) var(--btn-pad-x); font-size: var(--btn-font-size); font-weight: 600; line-height: var(--btn-line-height);
  min-height: var(--btn-height); cursor: pointer; font-family: inherit; text-decoration: none;
  transition: background .18s ease, border-color .18s ease;
}
.auth-btn:hover { background: var(--surface-2); }
.auth-btn svg { width: 20px; height: 20px; flex: none; display: block; }
.auth-btn:disabled { opacity: .5; cursor: not-allowed; }
.auth-btn:disabled:hover { background: var(--surface); }
.terms-check { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 14px; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); cursor: pointer; text-align: left; }
.terms-check input[type="checkbox"] { flex: none; width: 18px; height: 18px; min-height: 18px; margin: 1px 0 0; accent-color: var(--color-primary); cursor: pointer; }
.terms-check a { font-weight: 600; }

.who-link {
  display: inline; background: none; border: 0; padding: 0; margin: 0; min-height: 0;
  font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; border-radius: 4px; text-decoration: none;
}
.who-link:hover { color: var(--accent-ink); text-decoration: underline; }

/* Profile */
.warn-box { border: 1px solid #e8cf8f; border-radius: 12px; padding: 12px 14px; margin-top: 4px; font-size: 13.5px; background: #fdf6e0; color: var(--ink-soft); }
.warn-box b { color: var(--ink); }
#profileView .profile-col { max-width: 760px; margin: 0 auto; padding-bottom: 56px; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-avatar { flex: none; width: 56px; height: 56px; border: 0; box-shadow: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 23px; font-weight: 800; overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-id { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.profile-name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-sub { color: var(--ink-faint); font-size: 13px; font-weight: 500; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-bio { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-soft); overflow-wrap: break-word; }
.profile-avatar-wrap { position: relative; flex: none; width: 40px; height: 40px; cursor: pointer; border-radius: 50%; }
.profile-avatar-wrap:focus-visible { outline: 2px solid var(--color-ring); outline-offset: 2px; }
.profile-avatar-wrap .profile-avatar { width: 40px; height: 40px; font-size: 16px; }
.avatar-edit-icon { position: absolute; right: -2px; bottom: -2px; width: 21px; height: 21px; border-radius: 50%; background: var(--color-primary); color: var(--color-on-primary); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.avatar-edit-icon svg { width: 11px; height: 11px; }
.profile-avatar-wrap .avatar-edit-icon { right: -1px; bottom: -1px; width: 15px; height: 15px; }
.profile-avatar-wrap .avatar-edit-icon svg { width: 8px; height: 8px; }
.krak-line { margin-top: 14px; padding: 11px 13px; background: var(--surface-2); border-radius: 12px; font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.krak-line .krak-label { color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.krak-line .krak-val { font-weight: 800; }
.krak-line .krak-missing { font-weight: 700; color: #92600a; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 80px); z-index: 120;
  background: #17171c; color: #f4f4f5; font-weight: 600; font-size: 13px;
  padding: 12px 22px; border-radius: var(--radius-pill); box-shadow: var(--shadow-md);
  transition: transform .3s ease; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* Footer: ends at the copyright and theme row, no divider after it */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 0; }
.foot-in { padding-top: 16px; padding-bottom: 16px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 16px 56px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 16px; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 22px 20px; } }
.foot-brand-line { display: flex; align-items: center; gap: 9px; }
.foot-tag { margin: 6px 0 0; color: var(--ink-faint); font-size: 13px; line-height: 1.5; max-width: 44ch; }
.foot-col h3 { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); font-family: var(--font-mono); }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.foot-col a, .foot-col button {
  display: inline-flex; align-items: center; min-height: 1.9rem; padding: 2px 0;
  color: var(--ink-soft); font-size: 13.5px; font-weight: 500; text-decoration: none;
  background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left;
  transition: color .18s ease;
}
.foot-col a:hover, .foot-col button:hover { color: var(--ink); }
.foot-socials { display: flex; gap: 8px; flex-wrap: wrap; }
.foot-socials a {
  width: 38px; height: 38px; min-height: 38px; padding: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--ink-soft);
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.foot-socials a:hover { color: var(--ink); background: var(--surface-2); border-color: var(--line-strong); }
.foot-socials svg { width: 17px; height: 17px; fill: currentColor; display: block; }
.foot-meta {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px;
  align-items: center;
  margin-top: 16px; color: var(--ink-faint); font-size: 12.5px;
}
.foot-copy { grid-column: 1; }
.foot-theme { grid-column: 2; display: flex; align-items: center; justify-self: end; }
@media (max-width: 820px) {
  .foot-meta { grid-template-columns: 1fr 1fr; }
  .foot-theme { grid-column: 2; }
}
.theme-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill); padding: 3px;
  box-shadow: var(--shadow-sm);
}
.theme-toggle button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 16px;
  border: 0; border-radius: var(--radius-pill); background: transparent;
  color: var(--ink-soft); font-family: inherit; font-size: 13.5px; font-weight: 700;
  cursor: pointer; transition: background .18s ease, color .18s ease;
}
.theme-toggle button svg { width: 15px; height: 15px; flex: none; display: block; }
.theme-toggle button:hover { color: var(--ink); }
.theme-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

/* Mobile */
@media (max-width: 640px) {
  .board { gap: 24px; padding: 0 0 116px; }
  #listView > .sec-head { margin-top: 16px; }
  .sec-head { flex-wrap: wrap; gap: 4px 10px; }
  .sec-head .note { white-space: normal; }
  .toolbar .filters { align-self: stretch; }
  .filters { display: flex; width: 100%; }
  .pill { text-align: center; font-size: 13px; padding-left: 7px; padding-right: 7px; }
  .search-box input { font-size: 16px; min-height: 3.25rem; }
  .bt-main { padding: 14px 14px 12px; }
  .bt-stub { padding: 10px 14px 12px; flex-wrap: wrap; }
  .banner { margin-top: 10px; border-radius: 20px; }
  .feed-item { flex-wrap: wrap; }
  .feed-item .when { padding-top: 0; }
  .lb-row { grid-template-columns: 26px 28px minmax(0, 1fr) auto 8px; gap: 8px; padding: 9px 10px; }
  .lb-rank { width: 26px; height: 26px; }
  .lb-avatar { width: 28px; height: 28px; font-size: 12px; }
  .lb-total { font-size: 15px; }
  .detail-reward-row { align-items: flex-start; }
  .panel { padding: 18px 16px; }
  .toast { width: calc(100vw - 32px); }
}
@media (max-width: 359px) { .pill { font-size: 11.5px; padding-left: 4px; padding-right: 4px; } }
@media (max-width: 400px) {
  .nav-in { gap: 4px; }
  .bt-top { flex-wrap: wrap; }
}

/* Docs */
.docs-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 48px; align-items: start; padding: 28px 0 72px; }
.docs-side { position: sticky; top: 88px; }
.docs-side-title { margin: 0 0 12px; padding: 0 12px; font-size: 13px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.docs-nav-group { margin-bottom: 18px; }
.docs-nav-label { margin: 0 0 5px; padding: 0 12px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.docs-nav { list-style: none; margin: 0; padding: 0; }
.docs-nav a {
  display: block; padding: 7px 12px; border-radius: 10px;
  color: var(--ink-soft); font-size: 13.5px; font-weight: 600; line-height: 1.4; text-decoration: none;
  transition: background .18s ease, color .18s ease;
}
.docs-nav a:hover { background: var(--surface-2); color: var(--ink); }
.docs-nav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.docs-article { max-width: 760px; min-width: 0; }
.docs-title { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }
.docs-lede { margin: 10px 0 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); max-width: 62ch; }
.docs-sec { padding-top: 32px; margin-top: 32px; border-top: 1px solid var(--line); scroll-margin-top: 84px; }
.docs-sec h2 { margin: 0 0 10px; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
.docs-sec h3 { margin: 20px 0 6px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.docs-sec p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); }
.docs-sec p b, .docs-sec li b { color: var(--ink); }
.docs-sec ul { margin: 4px 0 10px; padding-left: 18px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.65; }
.docs-sec li { margin-bottom: 5px; }
.docs-sec li::marker { color: var(--ink-faint); }
.docs-callout { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 14px; padding: 14px 16px; margin-top: 16px; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.docs-callout b { color: var(--ink); }
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; gap: 0; padding-top: 22px; }
  .docs-side { display: none; }
  .docs-article { max-width: none; }
  .docs-title { font-size: 26px; }
}

/* Legal */
.legal-wrap { max-width: 760px; padding: 4px 0 72px; }
.legal-part { margin: 44px 0 0; padding-top: 30px; border-top: 2px solid var(--ink); font-size: 24px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.2; scroll-margin-top: 84px; }
.legal-updated { margin: 8px 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); }
.legal-cross { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.6; color: var(--ink-faint); }

/* Edit profile form */
.edit-panel { padding: 22px 24px 24px; }
.edit-head h3 { margin: 0; font-size: 16.5px; }
.edit-sub { margin: 3px 0 0; color: var(--ink-faint); font-size: 13px; line-height: 1.5; }
.edit-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.edit-group-title { margin: 0 0 2px; font-size: 16.5px; font-weight: 700; color: var(--ink); }
.edit-panel .f-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 14px 0 5px; }
.edit-panel .f-row label.f { margin: 0; }
.edit-panel .form-row-2 label.f { margin-top: 4px; }
.f-count { flex: none; font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; }
.edit-actions { justify-content: space-between; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.edit-hint { max-width: 36ch; line-height: 1.45; }
@media (max-width: 520px) {
  .edit-panel { padding: 18px 16px 20px; }
  .edit-hint { display: none; }
  .edit-actions { justify-content: flex-end; }
}

/* Profile history: two tables, merging into one */
.pf-history { --pf-row-h: 68px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: stretch; }
.pf-history[hidden] { display: none; }
.pf-merged { margin-top: 14px; }
.pf-merged-card { padding: 16px 18px; }
.pf-history .feed-block { display: flex; flex-direction: column; min-width: 0; }
.pf-history .feed-block + .feed-block { margin-top: 0; }
.pf-history .feed-card { flex: 1 1 auto; display: flex; flex-direction: column; }
.pf-list {
  list-style: none; margin: 0; padding: 0;
  height: calc(var(--pf-row-h) * 4); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.pf-list::-webkit-scrollbar { width: 6px; }
.pf-list::-webkit-scrollbar-track { background: transparent; }
.pf-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.pf-list::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
.pf-list .feed-empty { height: 100%; display: flex; align-items: center; justify-content: center; }
.pf-item {
  display: flex; width: 100%; height: var(--pf-row-h); align-items: center; gap: 8px; text-align: left;
  background: none; border: 0; border-top: 1px solid var(--line);
  padding: 10px 14px; font: inherit; cursor: pointer; color: var(--ink-soft);
  transition: background .15s ease;
}
.pf-list li:first-child .pf-item { border-top: 0; }
.pf-item:hover { background: var(--surface-2); }
.pf-item.on { background: var(--accent-soft); }
.pf-item-text {
  flex: 1; min-width: 0; font-size: 13px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pf-item-text b { color: var(--ink); font-weight: 700; }
.pf-item-text .placed-label { font-weight: 500; }
.pf-item-meta { flex: none; display: flex; align-items: center; gap: 6px; }
.pf-item .when { color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.pf-chev { color: var(--ink-faint); font-size: 15px; line-height: 1; transition: transform .15s ease; }
.pf-item.on .pf-chev { transform: rotate(90deg); color: var(--accent-ink); }
.pf-detail-top { display: flex; align-items: center; gap: 10px; }
.pf-detail-top .when { color: var(--ink-faint); font-size: 11.5px; white-space: nowrap; }
.pf-detail-close {
  margin-left: auto; flex: none; width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-faint);
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.pf-detail-close svg { width: 16px; height: 16px; display: block; }
.pf-detail-close:hover { background: var(--surface-2); color: var(--ink); }
.pf-detail-close:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; color: var(--ink); }
.pf-detail-text { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.pf-detail-text b { color: var(--ink); font-weight: 700; }
.pf-detail-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pf-detail-link { text-decoration: none; }
@media (max-width: 640px) { .pf-history { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .bticket:hover { transform: none; }
}

/* Compatibility: form and admin classes, mapped onto the tokens above. */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 14px; padding: 10px 13px; min-height: 2.75rem;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--color-secondary); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
textarea.textarea, textarea.input { min-height: 82px; resize: vertical; }
.field label { display: block; font-size: 12.5px; font-weight: 700; margin: 0 0 5px; }
.field .hint { color: var(--ink-faint); font-size: 12px; margin-top: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-ink);
}
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 10px; font-weight: 600; font-size: 13.5px; }
.flash-success { background: var(--green-soft); color: var(--green); }
.flash-error { background: #fef3f2; color: #b42318; }
:root[data-theme="dark"] .flash-error { background: #33150f; color: #f3a08f; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.text-muted { color: var(--ink-soft); }
.text-faint { color: var(--ink-faint); }
.text-accent { color: var(--color-secondary); }
.bg-lavender { background-color: var(--accent-soft); }
.bg-surface { background-color: var(--surface); }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.x-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-faint);
}
.x-btn:hover { background: var(--surface-2); color: var(--ink); }
.x-btn:focus-visible { outline: 2px solid var(--color-secondary); }
.m-cell-label { display: none; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13.5px; }
.admin-table th { color: var(--ink-faint); font-size: 12px; }
.admin-nav a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--ink-soft); font-size: 14px; }
.admin-nav a:hover { background: var(--surface-2); color: var(--ink); }
.admin-nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.admin-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; align-items: start; }
.admin-side { border-right: 1px solid var(--line); background: var(--surface); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.admin-main { padding: 24px; max-width: 1080px; width: 100%; margin-inline: auto; }
.title-action .btn { flex: none; }
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-main { min-width: 0; }
  .admin-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px; }
  .admin-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-nav a { display: inline-block; padding: 7px 10px; }
  .admin-topbar { padding: 12px 14px; flex-wrap: wrap; }
  .admin-main { padding: 16px 14px; }
  .admin-main .flex { flex-wrap: wrap; }
  .title-action { flex-direction: column; align-items: stretch; gap: 10px; }
  .title-action .btn { text-align: center; }
  .admin-table { min-width: 520px; }
  .admin-table th, .admin-table td { overflow-wrap: anywhere; }
  /* Mobile card layout for the bounties, grants and users lists: rows
     stack, the headline cell leads, data cells carry their column name,
     and the actions wrap onto their own line. No horizontal scrolling. */
  .admin-table.m-cards { min-width: 0; }
  .admin-table.m-cards thead { display: none; }
  .admin-table.m-cards tbody { display: block; }
  .admin-table.m-cards tr { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .admin-table.m-cards td { display: block; border-bottom: 0; padding: 0; }
  .admin-table.m-cards td.m-head { order: -1; font-size: 15px; font-weight: 700; color: var(--ink); }
  .admin-table.m-cards .m-cell-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 1px; }
  .admin-table.m-cards td.m-actions { margin-top: 7px; }
  .admin-table.m-cards td.m-actions > span { display: flex; flex-wrap: wrap; gap: 6px; white-space: normal; }
  .admin-table.m-cards-users .u-who { display: flex; flex-direction: column; }
  .admin-table.m-cards-users .u-who br { display: none; }
  .admin-table.m-cards-users .u-uname { order: -1; font-size: 15px; font-weight: 700; color: var(--ink); }
}

/* Funded bounties panel on profiles: at most five rows visible, the list scrolls beyond that. */
.funded-block { margin-top: 14px; }
.funded-list {
  list-style: none; margin: 0; padding: 0;
  max-height: calc(68px * 5); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.funded-list::-webkit-scrollbar { width: 6px; }
.funded-list::-webkit-scrollbar-track { background: transparent; }
.funded-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.funded-row {
  display: flex; align-items: center; gap: 10px; height: 68px; padding: 0 16px;
  border-top: 1px solid var(--line);
  color: inherit; text-decoration: none;
}
.funded-list li:first-child .funded-row { border-top: 0; }
.funded-row:hover { background: var(--surface-2); }
.funded-name { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; min-width: 0; }
.funded-name .verified-badge { margin-left: 0; }
.funded-total { margin-left: auto; font-weight: 700; white-space: nowrap; }
.funded-total small { font-size: 1em; font-weight: 600; color: var(--ink-faint); }

/* Admin username picker (bounty form project tag and funder) */
.picker { position: relative; }
.picker-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-md); overflow: hidden; max-height: 260px; overflow-y: auto;
}
.picker-item {
  display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 9px 12px;
  background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: var(--ink);
}
.picker-item:hover { background: var(--surface-muted); }
.picker-item-main { font-weight: 600; }
.picker-item-sub { color: var(--ink-faint); font-size: 13px; }

/* Admin banner slide manager and image previews */
.slide-block { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.banner-thumb { max-width: 320px; border-radius: 10px; display: block; margin-bottom: 8px; }
.logo-preview { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; display: block; margin: -6px 0 14px; }
.logo-thumb { width: 30px; height: 30px; object-fit: cover; border-radius: 9px; display: block; }
