:root {
  --bg: var(--tg-theme-secondary-bg-color, #efeee8);
  --surface: var(--tg-theme-bg-color, #fbfaf6);
  --surface-2: #f5f4ef;
  --ink: var(--tg-theme-text-color, #171915);
  --muted: var(--tg-theme-hint-color, #777b72);
  --line: rgba(23, 25, 21, .11);
  --accent: #b8ef58;
  --accent-ink: #17200a;
  --violet: #7c62ed;
  --orange: #f49b55;
  --red: #dd5d5d;
  --blue: #499bd8;
  --shadow: 0 18px 55px rgba(28, 31, 24, .09);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% -10%, rgba(184, 239, 88, .23), transparent 28rem),
    radial-gradient(circle at -10% 55%, rgba(124, 98, 237, .09), transparent 22rem),
    var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, textarea, select { color: inherit; font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); line-height: 1.55; }
.small { font-size: 13px; }
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .17;
  background-image: radial-gradient(rgba(25, 27, 23, .22) .55px, transparent .55px);
  background-size: 5px 5px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.splash, .access-gate {
  position: fixed; inset: 0; z-index: 100; display: grid; place-content: center;
  text-align: center; background: #121410; color: #f4f4ed;
}
.splash strong { letter-spacing: .2em; font-size: 13px; margin-top: 24px; }
.splash small { color: #92968b; margin-top: 7px; }
.radar-loader {
  width: 94px; height: 94px; border: 1px solid rgba(184,239,88,.32); border-radius: 50%;
  margin: auto; position: relative; background: radial-gradient(circle, rgba(184,239,88,.16), transparent 60%);
}
.radar-loader::before, .radar-loader::after {
  content: ""; position: absolute; border: 1px solid rgba(184,239,88,.2); border-radius: 50%; inset: 16px;
}
.radar-loader::after { inset: 33px; background: var(--accent); border: 0; }
.radar-loader span { position: absolute; left: 50%; top: 50%; width: 42%; height: 2px; transform-origin: 0 50%; background: linear-gradient(90deg, var(--accent), transparent); animation: sweep 1.15s linear infinite; }
.radar-loader i { width: 7px; height: 7px; background: var(--violet); position: absolute; border-radius: 50%; right: 18px; top: 27px; box-shadow: 0 0 15px var(--violet); }
@keyframes sweep { to { transform: rotate(360deg); } }

.access-gate { padding: 24px; background: var(--bg); color: var(--ink); }
.gate-card { max-width: 390px; padding: 38px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 30px; box-shadow: var(--shadow); }
.gate-card h1 { font-size: 30px; margin: 10px 0 14px; letter-spacing: -.04em; }
.gate-icon { width: 58px; height: 58px; border-radius: 18px; display: grid; place-content: center; margin: 0 auto 24px; background: var(--accent); color: var(--accent-ink); font-size: 28px; }

.app { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: calc(72px + var(--safe-top)); padding: var(--safe-top) 18px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--bg) 87%, transparent); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line);
}
.brand { border: 0; background: transparent; display: flex; align-items: center; gap: 10px; padding: 0; text-align: left; }
.brand-mark { width: 34px; height: 34px; position: relative; border: 1px solid var(--line); border-radius: 50%; display: grid; place-content: center; }
.brand-mark::before { content: ""; width: 16px; height: 16px; border: 1px solid var(--accent); border-radius: 50%; }
.brand-mark i { position: absolute; width: 15px; height: 2px; background: var(--accent); left: 50%; top: 50%; transform-origin: left; transform: rotate(-38deg); }
.brand b { display: block; letter-spacing: .14em; font-size: 13px; }
.brand small { display: block; font-size: 9px; color: var(--muted); letter-spacing: .1em; margin-top: 2px; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.live-pill { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; font-size: 11px; font-weight: 700; }
.live-pill i, .pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: #79bf3f; box-shadow: 0 0 0 4px rgba(121,191,63,.13); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(121,191,63,0); } }
.avatar { width: 38px; height: 38px; border: 0; border-radius: 13px; background: var(--ink); color: var(--surface); font-weight: 800; }

.content { width: min(100%, 1080px); margin: 0 auto; padding: 0 16px calc(104px + var(--safe-bottom)); }
.page { display: none; animation: enter .26s ease both; padding-top: 26px; }
.page.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.2; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.hero { position: relative; min-height: 238px; padding: 30px 24px; overflow: hidden; border-radius: 30px; color: #f4f4ed; background: #151713; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; width: 200px; height: 200px; right: -70px; bottom: -100px; border-radius: 50%; background: var(--accent); filter: blur(3px); opacity: .82; }
.hero .eyebrow { color: #9da191; display: flex; align-items: center; gap: 8px; }
.hero h1 { position: relative; z-index: 2; font-size: clamp(38px, 10vw, 64px); line-height: .96; letter-spacing: -.055em; margin: 31px 0 14px; max-width: 610px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-copy { position: relative; z-index: 2; color: #aeb2a4; max-width: 440px; line-height: 1.55; margin: 0; font-size: 13px; }
.hero-orbit { position: absolute; width: 158px; height: 158px; right: 18px; top: 33px; border: 1px solid rgba(184,239,88,.23); border-radius: 50%; opacity: .8; }
.hero-orbit::before { content: ""; position: absolute; inset: 32px; border: 1px solid rgba(184,239,88,.3); border-radius: 50%; }
.hero-orbit span { position: absolute; inset: 63px; border-radius: 50%; background: var(--accent); }
.hero-orbit i { position: absolute; width: 51%; height: 1px; background: linear-gradient(90deg,var(--accent),transparent); left: 50%; top: 50%; transform-origin: left; animation: sweep 4s linear infinite; }
.hero-orbit b { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--violet); top: 38px; right: 27px; box-shadow: 0 0 16px var(--violet); }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 26px; }
.metric-card { min-width: 0; padding: 17px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 30px rgba(25,27,21,.035); }
.metric-card span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-card b { display: block; margin-top: 8px; font-size: 25px; letter-spacing: -.04em; }
.metric-card.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.metric-card.accent span { color: rgba(23,32,10,.65); }
.skeleton-grid { min-height: 82px; border-radius: 18px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent) var(--surface); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.feed-toolbar { display: grid; grid-template-columns: 1fr 50px; gap: 9px; }
.search-box { height: 50px; padding: 0 16px; display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.search-box:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,98,237,.11); }
.search-box svg { width: 20px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 14px; }
.icon-button, .round-button { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; font-weight: 800; }
.icon-button { height: 50px; font-size: 20px; }
.chips { display: flex; gap: 8px; margin: 12px -16px 24px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar, .bottom-nav::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); border-radius: 99px; padding: 9px 13px; font-size: 12px; font-weight: 700; }
.chip.active { color: #f6f6ef; background: var(--ink); border-color: var(--ink); }

.section-head, .page-title-row, .panel-head, .modal-head, .drawer-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-head { margin: 0 2px 13px; }
.section-head h2, .page-title-row h1, .panel h3, .modal h2 { margin: 4px 0 0; letter-spacing: -.035em; }
.section-head h2 { font-size: 23px; }
.page-title-row { align-items: flex-end; margin: 4px 2px 25px; }
.page-title-row h1 { font-size: clamp(36px, 9vw, 56px); line-height: 1; }
.page-title-row .muted { max-width: 570px; margin: 11px 0 0; font-size: 14px; }
.ghost-select { border: 0; outline: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; }

.job-list { display: grid; gap: 10px; }
.job-card { position: relative; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 35px rgba(25,27,21,.03); transition: transform .17s ease, border-color .17s ease; overflow: hidden; }
.job-card:active { transform: scale(.988); }
.job-card.new::before { content: ""; position: absolute; width: 4px; top: 16px; bottom: 16px; left: 0; background: var(--accent); border-radius: 0 5px 5px 0; }
.job-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.category-badge, .soft-badge, .risk-badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; border-radius: 99px; font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .04em; }
.category-badge { padding: 7px 9px; background: color-mix(in srgb, var(--cat-color, var(--violet)) 14%, var(--surface)); color: var(--cat-color, var(--violet)); }
.category-badge i { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.job-time { color: var(--muted); font-size: 11px; }
.job-card h3 { margin: 15px 0 8px; font-size: 18px; line-height: 1.18; letter-spacing: -.025em; }
.job-card p { color: var(--muted); margin: 0; line-height: 1.46; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.job-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.meta-pill { padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; font-weight: 700; }
.meta-pill.match { border-color: transparent; background: var(--accent); color: var(--accent-ink); }
.job-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.source-line { min-width: 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arrow-button { width: 34px; height: 34px; flex: none; border: 0; border-radius: 11px; background: var(--ink); color: var(--surface); font-size: 18px; }
.empty-state { text-align: center; padding: 54px 24px; color: var(--muted); }
.empty-state > span { display: grid; place-content: center; width: 54px; height: 54px; margin: auto; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); font-size: 24px; }
.empty-state h3 { color: var(--ink); margin: 16px 0 6px; }
.empty-state p { margin: 0 auto; max-width: 400px; font-size: 13px; line-height: 1.5; }

.btn { min-height: 48px; padding: 0 18px; border: 0; border-radius: 15px; font-weight: 800; transition: transform .15s ease; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px rgba(128,176,50,.16); }
.btn.dark { background: var(--ink); color: var(--surface); }
.btn.secondary { border: 1px solid var(--line); background: var(--surface-2); }
.btn.compact { min-height: 42px; padding: 0 15px; font-size: 12px; }
.btn.full { width: 100%; }
.text-button { padding: 7px; border: 0; background: transparent; color: var(--violet); font-size: 12px; font-weight: 750; }
.text-button.danger { color: var(--red); }

.system-banner { display: flex; align-items: center; gap: 13px; margin: 0 0 14px; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.system-banner > i { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 5px rgba(221,93,93,.1); }
.system-banner.online > i { background: #79bf3f; box-shadow: 0 0 0 5px rgba(121,191,63,.1); }
.system-banner b, .system-banner small { display: block; }
.system-banner b { font-size: 13px; }
.system-banner small { color: var(--muted); margin-top: 3px; font-size: 11px; }
.stack-list { display: grid; gap: 9px; }
.channel-row { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.channel-icon { width: 46px; height: 46px; display: grid; place-content: center; border-radius: 15px; background: #e8f1fb; color: #3488c5; font-size: 19px; font-weight: 800; }
.channel-row h3 { margin: 0 0 4px; font-size: 14px; }
.channel-row p { margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; }
.status-dot { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.status-dot.active i { background: #73b83a; }
.status-dot.error i { background: var(--red); }
.row-actions { display: flex; align-items: center; gap: 5px; }
.row-actions button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 11px; background: transparent; }

.panel { padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 34px rgba(25,27,21,.035); }
.panel + .panel { margin-top: 11px; }
.panel h3 { font-size: 19px; }
.soft-badge { padding: 7px 9px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.bar-chart { height: 190px; display: flex; align-items: flex-end; gap: clamp(3px, 1.4vw, 10px); margin-top: 25px; padding-top: 15px; border-bottom: 1px solid var(--line); }
.bar-column { height: 100%; min-width: 3px; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar-column i { width: 100%; max-width: 22px; min-height: 3px; border-radius: 6px 6px 2px 2px; background: var(--accent); transition: height .4s ease; }
.bar-column small { height: 15px; color: var(--muted); font-size: 8px; }
.stats-split { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 11px; }
.rank-list { display: grid; gap: 15px; margin-top: 20px; }
.rank-item > div:first-child { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; }
.rank-track { height: 7px; border-radius: 9px; background: var(--surface-2); overflow: hidden; margin-top: 7px; }
.rank-track i { display: block; height: 100%; border-radius: inherit; background: var(--violet); }

.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.team-card { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.team-card-top { display: flex; align-items: center; gap: 12px; }
.team-avatar { width: 45px; height: 45px; display: grid; place-content: center; border-radius: 15px; background: var(--ink); color: var(--surface); font-weight: 850; }
.team-card h3 { margin: 0 0 4px; font-size: 15px; }
.team-card p { margin: 0; color: var(--muted); font-size: 11px; }
.team-cats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.mini-chip { padding: 6px 8px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 9px; font-weight: 750; }
.team-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }

.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.status-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.status-card i { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--red); margin-bottom: 22px; }
.status-card.online i { background: #76bd3d; }
.status-card b, .status-card small { display: block; }
.status-card b { font-size: 14px; }
.status-card small { color: var(--muted); margin-top: 5px; line-height: 1.4; }
.large-input, .field input, .field select { width: 100%; border: 1px solid var(--line); outline: 0; background: var(--surface-2); border-radius: 14px; }
.large-input { min-height: 145px; resize: vertical; padding: 14px; margin: 8px 0 10px; line-height: 1.5; }
.large-input:focus, .field input:focus, .field select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,98,237,.1); }

.bottom-nav { position: fixed; z-index: 35; left: 10px; right: 10px; bottom: calc(8px + var(--safe-bottom)); min-height: 66px; display: flex; align-items: center; justify-content: space-around; padding: 6px; border: 1px solid rgba(23,25,21,.12); border-radius: 21px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(22px); box-shadow: 0 16px 45px rgba(20,22,18,.17); }
.bottom-nav .nav-item { position: relative; min-width: 0; flex: 1 1 0; border: 0; background: transparent; color: var(--muted); padding: 6px 3px; border-radius: 14px; }
.bottom-nav .nav-item span { display: block; font-size: 20px; line-height: 1; }
.bottom-nav .nav-item small { display: block; font-size: 8px; font-weight: 750; margin-top: 5px; }
.bottom-nav .nav-item.active { color: var(--ink); background: var(--accent); }
.nav-badge { position: absolute; right: 7px; top: 3px; min-width: 16px; height: 16px; display: grid; place-content: center; padding: 0 4px; border-radius: 99px; background: var(--violet); color: white; font-size: 8px; font-style: normal; }
.desktop-nav { display: none; }

.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(10,11,9,.48); backdrop-filter: blur(3px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 94dvh; padding: 8px 17px calc(22px + var(--safe-bottom)); background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: 0 -20px 70px rgba(15,17,13,.25); transform: translateY(105%); transition: transform .28s cubic-bezier(.22,.8,.25,1); overflow-y: auto; }
.drawer.open { transform: translateY(0); }
.drawer-handle { width: 38px; height: 4px; border-radius: 9px; background: var(--line); margin: 2px auto 10px; }
.drawer-top { position: sticky; top: -8px; z-index: 3; margin: 0 -17px; padding: 8px 17px 10px; background: color-mix(in srgb,var(--surface) 92%,transparent); backdrop-filter: blur(15px); }
.round-button { width: 38px; height: 38px; font-size: 21px; }
.drawer-content { padding-bottom: 15px; }
.detail-header { padding: 18px 2px 20px; border-bottom: 1px solid var(--line); }
.detail-header h2 { margin: 15px 0 11px; font-size: 29px; line-height: 1.04; letter-spacing: -.045em; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.detail-section { padding: 20px 2px; border-bottom: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 11px; font-size: 15px; }
.detail-section p { white-space: pre-wrap; margin: 0; font-size: 13px; line-height: 1.58; }
.original-box { max-height: 170px; overflow: auto; padding: 13px; border-radius: 14px; background: var(--surface-2); color: var(--muted); }
.skill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.risk-box { display: flex; gap: 10px; padding: 12px; margin-top: 10px; border: 1px solid color-mix(in srgb,var(--red) 35%,transparent); border-radius: 13px; background: color-mix(in srgb,var(--red) 7%,var(--surface)); color: var(--red); font-size: 12px; line-height: 1.4; }
.response-editor { width: 100%; min-height: 150px; resize: vertical; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); padding: 14px; outline: 0; line-height: 1.55; font-size: 13px; }
.recipient-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 10px 0; }
.recipient-row input { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); padding: 0 12px; outline: 0; }
.action-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; }
.sending-note { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; text-align: center; }

.modal { position: fixed; z-index: 70; left: 50%; bottom: calc(14px + var(--safe-bottom)); width: min(calc(100% - 20px), 480px); padding: 22px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: 0 25px 80px rgba(15,17,13,.3); transform: translateX(-50%); animation: modal-in .24s ease; }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.modal h2 { font-size: 25px; }
.modal > .muted { margin: 15px 0; font-size: 13px; }
.field { display: block; margin: 17px 0; }
.field > span, .field-label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 750; }
.field input { height: 48px; padding: 0 13px; }
.field select { height: 48px; padding: 0 13px; }
.check-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0 20px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; }
.check-chip span { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 10px; font-weight: 750; }
.check-chip input:checked + span { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 15px 0 20px; }
.switch-row span b, .switch-row span small { display: block; }
.switch-row span b { font-size: 12px; }
.switch-row span small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.switch-row input { position: absolute; opacity: 0; }
.switch-row > i { position: relative; width: 43px; height: 25px; flex: none; border-radius: 99px; background: #c9cbc4; transition: .2s; }
.switch-row > i::after { content: ""; position: absolute; width: 19px; height: 19px; top: 3px; left: 3px; border-radius: 50%; background: white; transition: .2s; box-shadow: 0 2px 5px rgba(0,0,0,.16); }
.switch-row input:checked + i { background: var(--accent); }
.switch-row input:checked + i::after { transform: translateX(18px); }
.range-field input { width: 100%; accent-color: var(--violet); }

.phone-login { margin: 20px 0 8px; text-align: left; }
.phone-login .field { margin: 10px 0; }
.modal.wide { width: min(calc(100% - 20px), 620px); max-height: calc(100dvh - 28px); overflow-y: auto; }
.field-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-split .field { margin-top: 0; }
.role-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 20px 0; }
.role-picker label { position: relative; }
.role-picker input { position: absolute; opacity: 0; }
.role-picker span { display: block; min-height: 92px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-2); }
.role-picker b, .role-picker small { display: block; }
.role-picker small { color: var(--muted); margin-top: 7px; line-height: 1.4; }
.role-picker input:checked + span { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,98,237,.11); background: color-mix(in srgb,var(--violet) 8%,var(--surface)); }
.consent-row { display: flex; align-items: flex-start; gap: 9px; margin: 13px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.45; text-align: left; }
.consent-row input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--violet); }
.market-tabs { display: flex; gap: 5px; padding: 5px; margin-bottom: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); overflow-x: auto; }
.market-tabs button { flex: 1; min-width: 105px; min-height: 39px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; }
.market-tabs button.active { background: var(--ink); color: var(--surface); }
.freelancer-grid, .plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.freelancer-card, .plan-card, .profile-card, .usage-card { padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 32px rgba(25,27,21,.035); }
.freelancer-card h3, .plan-card h3 { margin: 13px 0 5px; font-size: 18px; }
.freelancer-card p, .plan-card p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.freelancer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.freelancer-head .team-avatar { background: var(--violet); color: white; }
.rating { font-size: 12px; font-weight: 800; color: #b27d17; }
.plan-grid { grid-template-columns: repeat(3, 1fr); }
.plan-card { position: relative; display: flex; flex-direction: column; }
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184,239,88,.18); }
.plan-price { margin: 20px 0 13px; font-size: 34px; font-weight: 850; letter-spacing: -.05em; }
.plan-price small { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: 0; }
.plan-features { display: grid; gap: 8px; padding: 0; margin: 0 0 18px; list-style: none; color: var(--muted); font-size: 12px; }
.plan-features li::before { content: "✓"; color: #72ad39; font-weight: 900; margin-right: 7px; }
.plan-card .btn { margin-top: auto; }
.usage-card { margin: 0 0 13px; background: #171915; color: #f4f4ed; }
.usage-card p { color: #aeb2a4; margin: 8px 0 0; }
.usage-track { height: 9px; margin-top: 16px; background: #2b2e28; border-radius: 10px; overflow: hidden; }
.usage-track i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.profile-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 11px; margin-bottom: 11px; }
.profile-card h2 { margin: 11px 0 6px; font-size: 28px; letter-spacing: -.04em; }
.profile-card p { color: var(--muted); line-height: 1.5; }
.profile-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.profile-stat { padding: 14px; border-radius: 15px; background: var(--surface-2); }
.profile-stat b, .profile-stat small { display: block; }
.profile-stat b { font-size: 22px; }
.profile-stat small { color: var(--muted); margin-top: 3px; }
.referral-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 16px 0; }
.referral-box input { min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 13px; padding: 0 12px; background: var(--surface-2); }
.mini-metrics { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-metrics span { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.compact-list { display: grid; gap: 8px; margin-top: 15px; }
.admin-ops-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; margin-bottom: 11px; }
.compact-row, .deal-row, .my-job-row { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.compact-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compact-row b, .compact-row small { display: block; }
.compact-row small { color: var(--muted); margin-top: 4px; }
.deal-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; background: var(--surface); }
.deal-row h3, .my-job-row h3 { margin: 0 0 6px; font-size: 15px; }
.deal-row p, .my-job-row p { margin: 0; color: var(--muted); font-size: 11px; }
.deal-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.deal-actions button { min-height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 10px; font-weight: 800; }
.source-ribbon { display: inline-flex; margin-left: 5px; padding: 4px 7px; border-radius: 7px; background: color-mix(in srgb,var(--violet) 12%,var(--surface)); color: var(--violet); font-size: 8px; font-weight: 850; text-transform: uppercase; }

.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(92px + var(--safe-bottom)); width: fit-content; max-width: calc(100% - 30px); transform: translateX(-50%); padding: 12px 15px; border-radius: 13px; background: #1b1d19; color: #f5f5ef; box-shadow: 0 14px 40px rgba(0,0,0,.25); font-size: 12px; font-weight: 650; animation: toast-in .2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (max-width: 570px) {
  .hero-orbit { opacity: .38; right: -57px; top: 22px; }
  .hero h1 { max-width: 330px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .stats-split, .team-grid, .settings-grid, .freelancer-grid, .plan-grid, .profile-layout, .admin-ops-grid { grid-template-columns: 1fr; }
  .role-picker { grid-template-columns: 1fr; }
  .chart-panel { padding-left: 14px; padding-right: 14px; }
  .page-title-row { align-items: flex-start; flex-direction: column; }
  .page-title-row .btn { margin-top: 2px; }
  .compact-row { align-items: flex-start; flex-wrap: wrap; }
}

@media (max-width: 350px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .hero { padding-left: 19px; padding-right: 19px; }
  .bottom-nav { left: 6px; right: 6px; padding-left: 3px; padding-right: 3px; }
  .bottom-nav .nav-item small { font-size: 7px; }
  .live-pill span { display: none; }
}

@media (min-width: 900px) {
  .topbar { padding-left: 28px; padding-right: 28px; }
  .desktop-nav { position: fixed; z-index: 25; left: 22px; top: 95px; width: 172px; display: grid; gap: 5px; }
  .desktop-nav .nav-item { display: flex; align-items: center; gap: 11px; height: 44px; padding: 0 13px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); text-align: left; font-size: 12px; font-weight: 750; }
  .desktop-nav .nav-item span { font-size: 18px; }
  .desktop-nav .nav-item.active { background: var(--surface); color: var(--ink); box-shadow: 0 7px 25px rgba(25,27,21,.06); }
  .content { padding-left: 205px; padding-right: 28px; max-width: 1250px; }
  .bottom-nav { display: none; }
  .hero { padding: 40px; }
  .job-list { grid-template-columns: repeat(2, 1fr); }
  .drawer { left: auto; right: 18px; bottom: 18px; width: min(590px, calc(100% - 36px)); max-height: calc(100dvh - 36px); border-radius: 28px; }
  .modal { bottom: 50%; transform: translate(-50%,50%); }
  @keyframes modal-in { from { opacity: 0; transform: translate(-50%, calc(50% + 12px)); } }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--tg-theme-secondary-bg-color, #0f110e);
    --surface: var(--tg-theme-bg-color, #171916);
    --surface-2: #1e211c;
    --ink: var(--tg-theme-text-color, #f0f1e9);
    --muted: var(--tg-theme-hint-color, #92978c);
    --line: rgba(239, 241, 232, .1);
    --shadow: 0 18px 55px rgba(0,0,0,.18);
  }
  .avatar, .arrow-button { background: var(--accent); color: var(--accent-ink); }
  .chip.active { background: #efefe8; color: #151713; border-color: #efefe8; }
  .channel-icon { background: #192b39; }
  .noise { opacity: .08; }
}

body.tg-dark {
  --bg: var(--tg-theme-secondary-bg-color, #0f110e);
  --surface: var(--tg-theme-bg-color, #171916);
  --surface-2: #1e211c;
  --ink: var(--tg-theme-text-color, #f0f1e9);
  --muted: var(--tg-theme-hint-color, #92978c);
  --line: rgba(239, 241, 232, .1);
  --shadow: 0 18px 55px rgba(0,0,0,.18);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
