@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #101114;
  --bg-elev: #16181d;
  --surface: #1b1d23;
  --surface-2: #252830;
  --surface-3: #30333b;
  --text: #f5f5f5;
  --text-soft: #c7cbd3;
  --muted: #9297a2;
  --line: #343740;
  --line-soft: #2a2d35;
  --accent: #f05236;
  --accent-hover: #ff694b;
  --accent-soft: rgba(240, 82, 54, 0.14);
  --accent-glow: rgba(240, 82, 54, 0.22);
  --success: #a3d977;
  --warning: #e9b65d;
  --danger: #f05236;
  --silver: #b8bec9;
  --bronze: #c58b62;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.7);
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) calc(112px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
}
body.is-gated .page, body.is-gated .dock { visibility: hidden; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(240, 82, 54, 0.08), transparent 60%),
    radial-gradient(ellipse 50% 30% at 80% 0%, rgba(240, 82, 54, 0.04), transparent 50%);
  pointer-events: none;
  z-index: 0;
}
::selection { background: var(--accent); color: #fff; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }

.page { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px; padding: 10px 0;
  background: rgba(16, 17, 20, 0.82);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.topbar::after {
  content: ""; position: absolute; left: -16px; right: -16px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-soft), transparent);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 32px; height: 32px; flex: 0 0 auto; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.04em; }

.who, .login-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; color: var(--text); cursor: pointer; transition: border-color .15s, background .15s;
}
.login-btn { padding: 9px 16px; font-size: 12px; font-weight: 700; background: var(--accent); border-color: var(--accent); color: #fff; }
.login-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.who:hover { border-color: #4a4e58; background: var(--surface-2); }
.who-avatar {
  position: relative; width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text); font-size: 11px; font-weight: 800; text-transform: uppercase; overflow: hidden;
}
.who-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.who-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }

/* Hero */
.hero { padding: 28px 0 0; }
.kicker {
  display: flex; align-items: center; gap: 8px; margin: 0 0 14px;
  color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.kicker::before { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 1px; flex: 0 0 auto; }
h1 { margin: 0; font-size: clamp(36px, 9.5vw, 52px); font-weight: 800; line-height: 0.98; letter-spacing: -0.05em; color: var(--text); }
.lede { max-width: 46ch; margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.pulse { margin: 14px 0 0; color: var(--text-soft); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pulse::before { content: ""; width: 6px; height: 6px; background: var(--success); border-radius: 999px; box-shadow: 0 0 0 3px rgba(163, 217, 119, 0.12); }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  margin-top: 24px; background: var(--line-soft); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.stat { padding: 18px 12px; background: var(--surface); text-align: center; }
.stat b { display: block; font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--text); }
.stat span { display: block; margin-top: 6px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

/* Tabs / filters */
.tabs { display: flex; gap: 8px; margin-top: 24px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; padding: 9px 15px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer;
  transition: all .15s ease;
}
.tab:hover { color: var(--text); border-color: #4a4e58; }
.tab.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }

.filters { display: flex; gap: 8px; margin-top: 12px; }
.search {
  display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; height: 46px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; transition: border-color .15s;
}
.search:focus-within { border-color: #565a66; }
.search svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); }
.search input { width: 100%; min-width: 0; padding: 0; background: transparent; border: 0; color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.search input:focus, .search input:focus-visible { outline: none; box-shadow: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.sort { display: flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.sort button {
  padding: 8px 14px; background: transparent; border: 0; border-radius: 10px;
  color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.sort button:hover { color: var(--text); }
.sort button.is-active { background: var(--surface-3); color: var(--text); }

.niche-note {
  margin: 12px 0 0; padding: 11px 14px; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: 12px; color: var(--muted); font-size: 12px; line-height: 1.45;
}

/* Board / rows */
.board { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.row:hover { border-color: #454956; transform: translateY(-1px); }

.rank-badge {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 800;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.row-main { min-width: 0; }
.row-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px;
  background: var(--surface-3); color: var(--text-soft); font-size: 15px; font-weight: 800; text-transform: uppercase; overflow: hidden;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.tone-1 { background: rgba(240,82,54,.14); color: #ff7a62; }
.avatar.tone-2 { background: rgba(163,217,119,.12); color: #a3d977; }
.avatar.tone-3 { background: rgba(120,160,255,.12); color: #8fb1ff; }
.avatar.tone-4 { background: rgba(233,182,93,.12); color: #e9b65d; }
.avatar.tone-5 { background: rgba(184,190,201,.1); color: #c7cbd3; }

.row-title { min-width: 0; flex: 1; }
.service-link {
  display: block; min-width: 0; overflow: hidden; color: var(--text); font-size: 15.5px; font-weight: 800;
  line-height: 1.2; letter-spacing: -0.025em; text-decoration: none; white-space: nowrap; text-overflow: ellipsis;
}
.row-title > div:first-child { min-width: 0; }
.row-title > div:first-child .service-link { flex: 1; }
.place-badge { flex: 0 0 auto; }
.service-link:hover { color: #fff; }
.row-sub {
  display: flex; align-items: center; gap: 6px; margin-top: 3px; overflow: hidden;
  color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis;
}
.row-sub .dot { width: 3px; height: 3px; border-radius: 999px; background: #5a5f6b; flex: 0 0 auto; }
.author-link {
  padding: 0; background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer;
  text-decoration: underline; text-decoration-color: rgba(146,151,162,.35); text-underline-offset: 2px;
}
.author-link:hover { color: var(--text-soft); text-decoration-color: currentColor; }
.tagline {
  display: -webkit-box; margin: 8px 0 0; overflow: hidden; color: var(--muted);
  font-size: 12.5px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}

/* Vote */
.vote { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; min-width: 72px; padding-top: 1px; }
.count { font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--text); text-align: right; }
.delta { display: block; margin-top: 3px; color: var(--success); font-size: 10px; font-weight: 700; letter-spacing: 0.01em; }
.vote button {
  padding: 7px 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-soft); font-size: 11px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: all .15s ease;
}
.vote button:hover { background: var(--surface-3); color: var(--text); border-color: #4a4e58; }
.vote button.is-voted { background: var(--accent-soft); border-color: rgba(240,82,54,.35); color: #ff7a62; }
.vote button.is-voted:hover { background: rgba(240,82,54,.2); }
.vote button.is-transfer { background: transparent; border-color: rgba(240,82,54,.4); color: var(--accent); }
.vote button.is-transfer:hover { background: var(--accent-soft); }
.vote button.is-wait { background: transparent; border-style: dashed; border-color: var(--line); color: var(--muted); }
.vote button.is-own { background: transparent; border-style: dashed; color: var(--muted); }
.vote button.is-own:hover { border-color: #565a66; color: var(--text-soft); border-style: solid; }
.vote button:disabled { opacity: .55; cursor: not-allowed; }

/* Podium 1-3 */
.place-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap;
}
.place-badge svg { width: 12px; height: 12px; flex: 0 0 auto; }
.row.is-place-1, .row.is-place-2, .row.is-place-3 { position: relative; }
.row.is-place-1 {
  background: linear-gradient(180deg, rgba(240,82,54,.08) 0%, var(--surface) 100%);
  border-color: rgba(240,82,54,.45);
  box-shadow: 0 0 0 1px rgba(240,82,54,.12), 0 20px 40px -28px rgba(240,82,54,.35);
}
.row.is-place-1 .rank-badge { background: var(--accent); color: #fff; }
.row.is-place-1 .place-badge { background: rgba(240,82,54,.14); color: #ff7a62; border-color: rgba(240,82,54,.3); }
.row.is-place-1 .count { font-size: 28px; color: #fff; }
.row.is-place-1 .avatar { box-shadow: 0 0 0 1px rgba(240,82,54,.3); }

.row.is-place-2 {
  border-color: rgba(184,190,201,.35);
  background: linear-gradient(180deg, rgba(184,190,201,.05) 0%, var(--surface) 100%);
}
.row.is-place-2 .rank-badge { background: rgba(184,190,201,.16); color: var(--silver); }
.row.is-place-2 .place-badge { background: rgba(184,190,201,.1); color: var(--silver); border-color: rgba(184,190,201,.25); }

.row.is-place-3 {
  border-color: rgba(197,139,98,.35);
  background: linear-gradient(180deg, rgba(197,139,98,.05) 0%, var(--surface) 100%);
}
.row.is-place-3 .rank-badge { background: rgba(197,139,98,.14); color: var(--bronze); }
.row.is-place-3 .place-badge { background: rgba(197,139,98,.1); color: var(--bronze); border-color: rgba(197,139,98,.25); }

/* States / empty */
.state { padding: 48px 0; color: var(--muted); font-size: 14px; text-align: center; }
.empty {
  margin-top: 16px; padding: 44px 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); text-align: center;
}
.empty p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.total { margin: 18px 0 0; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-align: center; text-transform: uppercase; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border: 1px solid transparent; border-radius: 12px;
  font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; transition: all .15s ease;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-quiet { background: var(--surface-2); border-color: var(--line); color: var(--text-soft); }
.btn-quiet:hover:not(:disabled) { border-color: #565a66; color: var(--text); }
.btn-soft { background: var(--accent-soft); color: #ff7a62; border-color: transparent; }
.btn-soft:hover:not(:disabled) { background: rgba(240,82,54,.22); }
.btn-small { padding: 8px 12px; font-size: 11.5px; border-radius: 10px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:focus-visible, .tab:focus-visible, .sort button:focus-visible, .vote button:focus-visible,
.dock-item:focus-visible, .dock-add:focus-visible, .close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Dock */
.dock {
  position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); left: 50%; z-index: 40;
  display: flex; align-items: center; gap: 4px; padding: 6px;
  max-width: calc(100vw - 16px); flex-wrap: nowrap; overflow: hidden;
  background: rgba(27, 29, 35, 0.92); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: 0 20px 50px -20px rgba(0,0,0,.7);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transform: translateX(-50%);
}
.dock-item {
  display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: transparent; border: 0;
  border-radius: 16px; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.dock-item svg, .dock-add svg { width: 18px; height: 18px; flex: 0 0 auto; }
.dock-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.dock-item.is-active { color: var(--text); background: var(--surface-3); }
.dock-add {
  display: flex; align-items: center; gap: 7px; padding: 11px 16px; background: var(--accent); border: 0;
  border-radius: 16px; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.dock-add:hover { background: var(--accent-hover); }
.dock-plus { display: none; } /* replaced by icon */

/* Sheets */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.62); animation: fade-in .18s ease; }
.sheet-panel {
  position: relative; width: 100%; max-width: 560px; max-height: calc(92dvh - env(safe-area-inset-top));
  overflow-y: auto; padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 26px 26px 0 0; box-shadow: 0 -24px 60px rgba(0,0,0,.45);
  animation: sheet-up .24s cubic-bezier(.22,.8,.3,1);
}
.sheet-handle { width: 38px; height: 4px; margin: 4px auto 14px; background: #454956; border-radius: 999px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.035em; }
.close {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted); cursor: pointer;
}
.close:hover { color: var(--text); border-color: #565a66; }
.close svg { width: 16px; height: 16px; }

.field { display: block; margin-bottom: 13px; }
.field > span { display: block; margin-bottom: 6px; color: var(--text-soft); font-size: 12px; font-weight: 700; }
.field em { color: var(--muted); font-style: normal; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: #565a66; box-shadow: 0 0 0 3px rgba(240,82,54,.12);
}
.field input::placeholder, .field textarea::placeholder { color: #6f7580; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.form-error {
  margin: 4px 0 0; padding: 10px 12px; background: rgba(240,82,54,.1); border: 1px solid rgba(240,82,54,.2);
  border-radius: 10px; color: #ff7a62; font-size: 12.5px; font-weight: 600;
}
.form-actions { display: flex; gap: 8px; margin-top: 18px; }
.form-actions .btn-primary { flex: 1; }
.btn-delete {
  display: block; width: 100%; margin-top: 8px; padding: 10px; background: transparent; border: 0;
  color: #ff7a62; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.btn-delete:hover { color: var(--accent-hover); }

.sheet-note {
  margin: -6px 0 16px; padding: 11px 13px; background: var(--bg-elev); border: 1px solid var(--line-soft);
  border-radius: 12px; color: var(--muted); font-size: 12px; line-height: 1.45;
}
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; color: var(--text-soft); font-size: 12px; line-height: 1.45; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--accent); }

/* Vote sheet / captcha */
.vote-project { margin: 0 0 6px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.vote-rule { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.captcha-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.captcha-row img { width: 200px; height: 74px; background: #fffdf8; border: 1px solid var(--line); border-radius: 12px; flex: 0 0 auto; }
.captcha-refresh {
  padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text-soft); font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.captcha-refresh:hover { border-color: #565a66; color: var(--text); }

/* Profile */
.profile { padding-top: 18px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 0; background: transparent; border: 0;
  color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer;
}
.back-link:hover { color: var(--text); }
.profile-head {
  display: flex; gap: 16px; align-items: center; margin-top: 10px; padding: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
}
.profile-avatar {
  display: grid; place-items: center; width: 62px; height: 62px; flex: 0 0 auto; overflow: hidden;
  background: var(--surface-3); border-radius: 20px; color: var(--text); font-size: 24px; font-weight: 800;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-intro { min-width: 0; }
.profile-intro h1 { font-size: 26px; line-height: 1.1; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-handle, .profile-meta { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.profile-badge {
  display: inline-flex; margin-top: 10px; padding: 5px 10px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
}
.profile-badge.is-owner { background: var(--accent-soft); border-color: rgba(240,82,54,.25); color: #ff7a62; }
.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 12px;
  background: var(--line-soft); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.profile-stats div { padding: 16px 8px; background: var(--surface); text-align: center; }
.profile-stats b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.profile-stats span { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; font-weight: 600; }
.profile-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.profile-section-head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.03em; }
.profile-empty {
  margin: 0; padding: 24px 16px; background: var(--surface); border: 1px dashed var(--line);
  border-radius: 16px; color: var(--muted); font-size: 13px; text-align: center;
}
.profile-projects { display: flex; flex-direction: column; gap: 10px; }
.profile-project { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.profile-project-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.profile-project-top a { color: var(--text); font-size: 15px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.profile-project-top a:hover { color: #fff; }
.profile-project-top p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.status-chip { flex: 0 0 auto; padding: 4px 9px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-chip.is-live { background: rgba(163,217,119,.1); border-color: rgba(163,217,119,.25); color: var(--success); }
.status-chip.is-pending { background: rgba(233,182,93,.1); border-color: rgba(233,182,93,.25); color: var(--warning); }
.status-chip.is-rejected { background: rgba(240,82,54,.1); border-color: rgba(240,82,54,.25); color: #ff7a62; }
.status-chip.is-hidden { color: var(--muted); }
.profile-project-bottom { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.profile-votes { color: var(--text-soft); font-size: 12px; font-weight: 700; }
.profile-reason { color: #ff7a62; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-project-bottom .btn { margin-left: auto; }
.profile-votes-list { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.profile-vote-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.profile-vote-row:last-child { border-bottom: 0; }
.profile-vote-row b { display: block; font-size: 13px; font-weight: 700; color: var(--text); }
.profile-vote-row span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.profile-vote-time { color: var(--muted) !important; font-size: 11px !important; font-weight: 600; text-align: right; flex: 0 0 auto; }
.profile-logout { display: block; margin: 28px auto 0; padding: 10px; background: transparent; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.profile-logout:hover { color: #ff7a62; }

/* Gate / toast */
.gate { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 28px; background: rgba(16,17,20,.96); backdrop-filter: blur(8px); }
.gate-inner { max-width: 360px; width: 100%; }
.gate-mark { width: 48px; height: 48px; margin-bottom: 22px; }
.gate-inner h1 { margin: 0 0 12px; font-size: 34px; line-height: 1; letter-spacing: -0.04em; }
.gate-inner p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.tg-login { min-height: 44px; margin-bottom: 14px; }
.gate-hint { font-size: 12.5px !important; margin-bottom: 14px !important; }
.gate-inner .btn { width: 100%; }
.gate-close { display: block; margin: 16px 0 0; padding: 8px 0; background: transparent; border: 0; color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.gate-close:hover { color: var(--text); }

.toast {
  position: fixed; bottom: calc(92px + env(safe-area-inset-bottom)); left: 50%; z-index: 70;
  max-width: calc(100vw - 32px); padding: 11px 18px; background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 999px; color: var(--text); font-size: 13px; font-weight: 700; text-align: center;
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.6);
  opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .18s, transform .18s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Animations */
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.row { animation: rise .28s ease both; }
.row:nth-child(2) { animation-delay: .03s; }
.row:nth-child(3) { animation-delay: .06s; }
.row:nth-child(4) { animation-delay: .09s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Responsive */
@media (min-width: 640px) {
  .tabs { flex-wrap: wrap; overflow: visible; }
  .sheet { align-items: center; padding: 24px; }
  .sheet-panel { border-radius: 24px; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
  .row { padding: 16px; gap: 14px; }
  .rank-badge { width: 38px; height: 38px; }
}
@media (max-width: 520px) {
  .dock-item span, .dock-add span:not(.dock-plus) { display: none; }
  .dock-item, .dock-add { padding: 12px 14px; min-height: 44px; }
}
@media (max-width: 420px) {
  .page { padding: 0 14px; }
  .topbar::after { left: -14px; right: -14px; }
  .row { padding: 12px; gap: 10px; }
  .place-badge span { display: none; }
  .place-badge { padding: 4px 6px; }
  .rank-badge { width: 30px; height: 30px; font-size: 11px; border-radius: 8px; }
  .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
  .count { font-size: 20px; }
  .row.is-place-1 .count { font-size: 24px; }
  .vote { min-width: 60px; }
  .vote button { padding: 8px 10px; font-size: 10.5px; min-height: 34px; }
  .dock-item span, .dock-add span:not(.dock-plus) { display: none; }
  .dock-item, .dock-add { padding: 12px 14px; min-height: 44px; }
  .dock-add svg { width: 20px; height: 20px; }
  .captcha-row img { width: 160px; height: 59px; }
  .profile-head { padding: 16px; gap: 12px; }
  .profile-avatar { width: 54px; height: 54px; border-radius: 16px; font-size: 20px; }
  .profile-intro h1 { font-size: 22px; }
  .who-name { max-width: 84px; }
  #detailSheet .sheet-panel { padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .page { padding: 0 12px; }
  .topbar::after { left: -12px; right: -12px; }
  h1 { font-size: 34px; }
  .stat b { font-size: 22px; }
  .filters { flex-direction: column; }
  .sort { width: 100%; }
  .sort button { flex: 1; }
  .row { gap: 8px; padding: 11px; }
  .rank-badge { width: 28px; height: 28px; font-size: 10px; }
  .avatar { width: 32px; height: 32px; font-size: 13px; }
  .service-link { font-size: 14.5px; }
  .count { font-size: 18px; }
  .row.is-place-1 .count { font-size: 22px; }
  .vote { min-width: 56px; }
  .vote button { padding: 7px 8px; font-size: 10px; }
  .dock { gap: 2px; padding: 5px; }
  .dock-item, .dock-add { padding: 11px 12px; }
  .detail-hero { gap: 12px; }
  .detail-avatar { width: 56px !important; height: 56px !important; font-size: 24px !important; border-radius: 16px !important; }
  .detail-info-label { flex-basis: 68px; font-size: 11px; }
  .detail-info-row { padding: 12px 14px; }
}
@media (max-width: 340px) {
  .page { padding: 0 10px; }
  .topbar::after { left: -10px; right: -10px; }
  .dock-item, .dock-add { padding: 10px 10px; }
  .row { grid-template-columns: auto minmax(0,1fr) auto; gap: 6px; padding: 10px; }
  .vote { min-width: 52px; }
  .vote button { padding: 6px 6px; font-size: 10px; }
  .sheet-panel { padding-left: 14px; padding-right: 14px; }
}

/* Niche picker */
.niche-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.niche-option { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 999px; color: var(--text-soft); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.niche-option:has(input:checked) { background: var(--accent-soft); border-color: rgba(240,82,54,.35); color: #ff7a62; }
.niche-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
fieldset.field { margin: 0 0 13px; padding: 0; border: 0; min-width: 0; }
fieldset.field > span { display: block; margin-bottom: 6px; color: var(--text-soft); font-size: 12px; font-weight: 700; }

/* Detail sheet */
#detailSheet .sheet-panel { max-width: 680px; max-height: calc(95dvh - env(safe-area-inset-top)); padding: 10px 24px calc(24px + env(safe-area-inset-bottom)); }
.detail-hero { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.detail-avatar { width: 68px !important; height: 68px !important; border-radius: 20px !important; font-size: 28px !important; flex: 0 0 auto; }
.detail-head-text { min-width: 0; flex: 1; }
.detail-name { margin: 0; font-size: clamp(24px, 5vw, 32px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; overflow-wrap: anywhere; }
.detail-tagline { margin: 8px 0 0; color: var(--text-soft); font-size: 15px; line-height: 1.5; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.detail-chip { display: inline-flex; align-items: center; padding: 6px 12px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 999px; color: var(--text-soft); font-size: 12px; font-weight: 700; }
.detail-chip-voted { background: rgba(163,217,119,.12); border-color: rgba(163,217,119,.25); color: var(--green); }
.detail-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; margin-bottom: 20px; background: var(--line-soft); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.detail-stats div { padding: 18px 16px; background: var(--surface-2); text-align: center; }
.detail-stats b { display: block; font-size: clamp(28px, 6vw, 36px); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.detail-stats span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.detail-info { margin-bottom: 20px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.detail-info-row { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.detail-info-row:last-child { border-bottom: 0; }
.detail-info-label { flex: 0 0 90px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding-top: 1px; }
.detail-info-value { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.detail-inline-link { padding: 0; background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: left; overflow-wrap: anywhere; }
.detail-inline-link:hover { color: var(--accent); }
.detail-desc { margin: 0 0 22px; padding: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; }
.detail-section-title { margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.detail-desc p { margin: 0; color: var(--text-soft); font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-actions .btn { flex: 1; min-width: 0; }
.share-icon-btn { display:grid; place-items:center; width:30px; height:30px; padding:0; background:transparent; border:1px solid transparent; border-radius:999px; color:var(--muted); cursor:pointer; }
.share-icon-btn:hover { color:var(--text); background:var(--surface-2); border-color:var(--line); }
.share-icon-btn svg { width:16px; height:16px; }
@media (max-width: 560px) { #detailSheet .sheet-panel { max-width: 100%; } }
@media (max-width: 420px) { .detail-actions .btn { flex: 1 1 calc(50% - 5px); } .detail-actions .btn-primary { flex-basis: 100%; } .detail-info-label { flex-basis: 74px; } }
@media (max-width: 400px) {
  #shareButton span { display: none; }
  #shareButton { padding: 11px 12px; }
}

/* Avatar upload */
.avatar-field > span { display:block; margin-bottom:6px; color: var(--text-soft); font-size:12px; font-weight:700; }
.avatar-field em { color: var(--muted); font-style: normal; font-weight: 500; }
.avatar-upload { display:flex; gap:14px; align-items:center; }
.avatar-preview { width:64px; height:64px; border-radius:18px; background: var(--surface-3); border:1px solid var(--line); display:grid; place-items:center; overflow:hidden; flex:0 0 auto; color:var(--muted); font-size:24px; font-weight:800; }
.avatar-preview img { width:100%; height:100%; object-fit:cover; display:block; }
.avatar-preview img[hidden] { display:none; }
.avatar-upload-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.avatar-upload-actions small { width:100%; color:var(--muted); font-size:11px; margin:0; }
.avatar-upload-btn { cursor:pointer; }

/* Niche filter dropdown */
.niche-filter { position: relative; margin-top: 24px; }
.niche-filter-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; transition: border-color .15s, background .15s;
}
.niche-filter-btn:hover { border-color: #4a4e58; background: var(--surface-2); }
.niche-filter-btn svg { width: 18px; height: 18px; color: var(--muted); transition: transform .18s; flex: 0 0 auto; }
.niche-filter.is-open .niche-filter-btn { border-color: #565a66; }
.niche-filter.is-open .niche-filter-btn svg { transform: rotate(180deg); }
.niche-filter-menu {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.7); overflow: hidden;
}
.niche-filter-search { padding: 10px; border-bottom: 1px solid var(--line-soft); }
.niche-filter-search input {
  width: 100%; padding: 10px 12px; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); font-size: 16px;
}
.niche-filter-search input:focus { outline: none; border-color: #565a66; }
.niche-filter-list { max-height: 280px; overflow-y: auto; padding: 6px; }
.niche-filter-option {
  width: 100%; display: block; padding: 11px 12px; background: transparent; border: 0; border-radius: 10px;
  color: var(--text-soft); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer;
}
.niche-filter-option:hover { background: rgba(255,255,255,.04); color: var(--text); }
.niche-filter-option.is-active { background: var(--accent-soft); color: #ff7a62; }
.niche-filter-empty { padding: 14px 12px; color: var(--muted); font-size: 13px; text-align: center; }
