:root {
  --ink: #13211e;
  --muted: #6f7d79;
  --line: #dde5e1;
  --paper: #f5f7f5;
  --white: #fff;
  --green: #153d35;
  --green-2: #1d5247;
  --mint: #a8e6ce;
  --accent: #e7ff76;
  --danger: #c74f4f;
  --shadow: 0 18px 50px rgba(20, 55, 47, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.sidebar-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 34px 24px 24px;
  display: flex;
  flex-direction: column;
  background: #0f2924;
  color: white;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: white;
  text-decoration: none;
  font: 800 20px "Manrope", sans-serif;
}
.brand > span:last-child span { color: var(--accent); }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
}
.brand-mark svg { width: 23px; fill: none; stroke: var(--green); stroke-width: 2.4; stroke-linejoin: round; }
.nav { display: grid; gap: 8px; margin-top: 52px; }
.nav-item, .nav-link {
  display: flex;
  gap: 13px;
  align-items: center;
  width: 100%;
  padding: 12px 13px;
  border: 0;
  border-radius: 10px;
  color: #afc2bd;
  background: transparent;
  text-align: left;
  font-weight: 600;
  text-decoration: none;
  transition: 160ms ease;
}
.nav-item:hover, .nav-link:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: var(--accent); background: rgba(231,255,118,.1); }
.nav-item .icon, .nav-link .icon { width: 21px; font-size: 21px; text-align: center; font-weight: 400; }
.sidebar-foot { margin-top: auto; }
.sidebar-foot > p { color: #78938c; font-size: 11px; line-height: 1.5; }
.sidebar-foot form { margin: 0 0 14px; }
.logout-link { border: 1px solid rgba(255,255,255,.09); border-radius: 10px; }
.mini-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
}
.mini-status strong, .mini-status small { display: block; }
.mini-status strong { font-size: 13px; }
.mini-status small { margin-top: 2px; color: #8ea59f; font-size: 10px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #71817d; }
.status-dot.running { background: var(--accent); box-shadow: 0 0 0 5px rgba(231,255,118,.1); }

main { min-width: 0; padding: 0 46px 60px; }
.topbar {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.topbar h1, .section-intro h2 { margin: 2px 0 0; font: 800 28px "Manrope", sans-serif; }
.eyebrow { margin: 0; color: #80908b; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.top-actions, .hero-actions, .dialog-actions { display: flex; align-items: center; gap: 10px; }
.btn {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: wait; opacity: .6; transform: none; }
.btn-primary { color: white; background: var(--green); box-shadow: 0 8px 22px rgba(21,61,53,.16); }
.btn-primary:hover { background: var(--green-2); }
.btn-ghost { color: var(--ink); border-color: var(--line); background: white; }
.btn-danger-ghost { color: #a74646; border-color: #ebcccc; background: white; }
.btn-light { background: var(--accent); color: var(--green); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.mobile-menu { display: none; border: 0; background: none; font-size: 24px; }

.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.hero {
  min-height: 330px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  border-radius: 22px;
  color: white;
  background:
    radial-gradient(circle at 75% 20%, rgba(137,218,187,.15), transparent 32%),
    linear-gradient(135deg, #0e332c, #164b40);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .08;
  background-image: linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(90deg, transparent, black);
}
.hero-copy { position: relative; z-index: 2; padding: 48px 0 42px 52px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 30px;
  color: #bfd0cc;
  background: rgba(255,255,255,.05);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}
.pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.hero h2 { margin: 20px 0 14px; font: 800 39px/1.14 "Manrope", sans-serif; letter-spacing: -.035em; }
.hero h2 em { color: var(--accent); font-style: normal; }
.hero-copy > p { max-width: 560px; margin: 0; color: #aec3be; line-height: 1.65; font-size: 14px; }
.hero-actions { margin-top: 26px; }
.hero-actions > span { color: #829e97; font-size: 11px; }
.radar-wrap { display: grid; place-items: center; position: relative; z-index: 2; }
.radar {
  position: relative;
  width: 245px;
  aspect-ratio: 1;
  border: 1px solid rgba(231,255,118,.18);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(231,255,118,.05) 0 2px, transparent 3px),
    repeating-radial-gradient(circle, transparent 0 41px, rgba(231,255,118,.12) 42px 43px);
}
.radar::before, .radar::after { content: ""; position: absolute; background: rgba(231,255,118,.1); }
.radar::before { width: 1px; height: 100%; left: 50%; }
.radar::after { height: 1px; width: 100%; top: 50%; }
.radar-line {
  position: absolute;
  inset: 50% 50% 0 0;
  border-right: 2px solid var(--accent);
  transform-origin: 100% 0;
  animation: sweep 5s linear infinite;
  background: linear-gradient(110deg, transparent 60%, rgba(231,255,118,.12));
}
@keyframes sweep { to { transform: rotate(360deg); } }
.radar-home {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  color: var(--green);
  background: var(--accent);
  box-shadow: 0 0 30px rgba(231,255,118,.2);
  font-size: 22px;
}
.radar i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: ping 2.8s var(--delay) infinite;
}
@keyframes ping { 50% { box-shadow: 0 0 0 8px rgba(231,255,118,0); } }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin: 17px 0; }
.metric-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px;
  border: 1px solid #e4eae7;
  border-radius: 13px;
  background: white;
}
.metric-card strong, .metric-card small { display: block; }
.metric-card strong { font: 800 20px "Manrope"; }
.metric-card small { margin-top: 1px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.metric-icon {
  flex: 0 0 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 19px;
}
.metric-icon.mint { background: #e3f6ee; color: #268265; }
.metric-icon.amber { background: #fff1d6; color: #c47a13; }
.metric-icon.blue { background: #e5eefc; color: #4779c5; }
.metric-icon.purple { background: #eee8fa; color: #7f63b4; }

.dashboard-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 17px; }
.panel { border: 1px solid #e2e9e5; border-radius: 15px; background: white; box-shadow: 0 1px 0 rgba(0,0,0,.01); }
.panel-head { padding: 21px 22px 16px; display: flex; justify-content: space-between; align-items: end; }
.panel-head h3, .settings-panel h3 { margin: 4px 0 0; font: 800 16px "Manrope"; }
.text-btn { border: 0; color: #357968; background: none; font-size: 11px; font-weight: 700; }
.live-label { color: #4a9b7f; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.live-label i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: #62d19e; }
.profile-list, .listing-list { padding: 0 10px 10px; }
.profile-row, .listing-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-top: 1px solid #edf1ef;
}
.profile-symbol { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: #e8f5ef; color: #347863; }
.row-main { min-width: 0; flex: 1; }
.row-main strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.row-main small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.smart-mini { display: inline-flex; width: fit-content; margin-top: 2px; padding: 3px 6px; border-radius: 6px; color: #236d59; background: #e4f4ed; font-weight: 800; }
.row-badge { padding: 4px 7px; border-radius: 5px; color: #347863; background: #e9f5f0; font-size: 9px; font-weight: 700; white-space: nowrap; }
.listing-row a { color: inherit; text-decoration: none; }
.listing-row .price { font-size: 12px; font-weight: 800; white-space: nowrap; }
.listing-row .feed-link { color: #24745e; font-size: 10px; font-weight: 800; text-decoration: underline; white-space: nowrap; }
.listing-source { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--green); font-size: 10px; font-weight: 800; }
.empty { padding: 32px 20px; color: var(--muted); text-align: center; font-size: 12px; }

.section-intro { display: flex; justify-content: space-between; align-items: end; margin: 18px 0 24px; }
.section-intro > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.profile-card { position: relative; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.profile-card.inactive { opacity: .62; }
.profile-card h3 { margin: 16px 0 4px; font: 800 17px "Manrope"; }
.profile-card > p { margin: 0; color: var(--muted); font-size: 12px; }
.card-top { display: flex; justify-content: space-between; }
.profile-card .profile-symbol { width: 45px; height: 45px; }
.toggle-active { border: 0; background: transparent; }
.filter-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.filter-tags span { padding: 5px 8px; border-radius: 6px; color: #55645f; background: #f0f4f2; font-size: 10px; }
.card-actions { display: flex; border-top: 1px solid #edf1ef; margin: 0 -22px -22px; }
.card-actions button { flex: 1; padding: 12px; border: 0; color: #4e625c; background: none; font-size: 11px; font-weight: 700; }
.card-actions button + button { border-left: 1px solid #edf1ef; color: var(--danger); }
.segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.listing-toolbar { display: flex; align-items: center; gap: 9px; }
.listing-toolbar .btn { min-height: 36px; padding-inline: 12px; font-size: 10px; }
.segmented button { padding: 7px 12px; border: 0; border-radius: 6px; color: var(--muted); background: none; font-size: 11px; }
.segmented button.active { color: white; background: var(--green); }
.listing-grid { display: grid; gap: 10px; }
.load-more-wrap { display: flex; justify-content: center; margin-top: 14px; }
.listing-card { position: relative; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.listing-source-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--green); font-size: 11px; font-weight: 800; }
.listing-delete { width: 30px; height: 30px; border: 1px solid #e4d1d1; border-radius: 50%; color: #a74646; background: white; font-size: 18px; line-height: 1; }
.listing-delete:hover { color: white; background: #a74646; }
.listing-body { min-width: 0; }
.listing-body h3 { margin: 5px 0 8px; font: 700 14px/1.4 "Manrope"; }
.listing-body h3 a { color: var(--ink); text-decoration: none; }
.listing-body h3 a:hover { color: #28745f; text-decoration: underline; }
.listing-body p { margin: 0; color: var(--muted); font-size: 11px; }
.smart-score { width: fit-content; display: inline-flex; align-items: center; gap: 7px; margin-top: 7px; padding: 5px 8px; border-radius: 8px; color: #153d35; background: #e4f4ed; font-size: 11px; font-weight: 800; }
.smart-score strong { font: 800 13px "Manrope"; }
.smart-score span { color: #2c745f; }
.listing-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 13px; color: #52635e; font-size: 11px; }
.listing-facts strong { color: var(--ink); font-size: 13px; }
.distance-badge { padding: 3px 6px; border-radius: 5px; color: #236d59; background: #e4f4ed; font-weight: 700; }
.score-chip-group, .score-warning-group { display: flex; flex-wrap: wrap; gap: 5px; flex-basis: 100%; }
.score-chip-group b, .score-warning-group b { padding: 4px 7px; border-radius: 999px; font-size: 10px; line-height: 1.2; font-weight: 800; }
.score-chip-group b { color: #236d59; background: #e4f4ed; }
.score-warning-group b { color: #9a6700; background: #fff1cc; }
.listing-direct-url { display: inline-block; margin-top: 9px; color: #21715b; font-size: 11px; font-weight: 800; text-decoration: underline; }

.notice { padding: 16px 18px; margin-bottom: 17px; border: 1px solid #eadca9; border-radius: 12px; background: #fffbea; }
.notice strong { font-size: 12px; }
.notice p { margin: 4px 0 0; color: #756b49; font-size: 11px; line-height: 1.5; }
.source-list { display: grid; gap: 10px; }
.source-section-head { display: flex; align-items: end; justify-content: space-between; margin: 24px 2px 10px; }
.source-section-head h3 { margin: 3px 0 0; font: 800 16px "Manrope"; }
.source-section-head > span { color: #39836c; font-size: 10px; font-weight: 700; }
.custom-source-head { margin-top: 34px; }
.source-card { display: flex; align-items: center; gap: 15px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.source-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--green); font-weight: 800; }
.source-card .row-main small { word-break: break-all; }
.source-status { display: flex; align-items: center; gap: 5px; margin-top: 6px; color: #4b806f; font-size: 9px; }
.source-status i { width: 6px; height: 6px; border-radius: 50%; background: #52b38f; }
.source-status.error { color: #a94b4b; }
.source-status.error i { background: #d26060; }
.source-status.warning { color: #9a6700; }
.source-status.warning i { background: #f5b942; }
.source-status.external { color: #8a7443; }
.source-status.external i { background: #c79c3b; }
.source-open { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--green); text-decoration: none; font-size: 10px; font-weight: 700; white-space: nowrap; }
.source-empty { border: 1px dashed var(--line); border-radius: 12px; background: rgba(255,255,255,.45); }
.icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; color: var(--danger); background: white; }
.admin-users-list { display: grid; gap: 9px; }
.admin-user-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
}
.admin-user-row.pending { border-color: #eadca9; background: #fffbea; }
.admin-user-row.rejected, .admin-user-row.revoked { opacity: .7; }
.admin-user-row.revoked { background: #fff7f7; }

.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.settings-panel { padding: 22px; }
.settings-panel.wide { grid-column: 1 / -1; }
.channel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 19px; }
.channel-head > div { flex: 1; }
.channel-head h3 { margin: 0; }
.channel-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.channel-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--green); font-weight: 800; }
.channel-icon.discord { background: #5865f2; }
.channel-icon.telegram { background: #269ed8; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three-fields { display: grid; grid-template-columns: 2fr .6fr 1.5fr; gap: 10px; }
.switch input { display: none; }
.switch span { display: block; width: 38px; height: 22px; padding: 3px; border-radius: 20px; background: #ccd6d2; transition: .2s; }
.switch span::after { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: white; transition: .2s; }
.switch input:checked + span { background: #3e9f7e; }
.switch input:checked + span::after { transform: translateX(16px); }
.check-row { display: block; margin: 10px 0; color: var(--muted); font-size: 11px; }

.field { display: grid; gap: 6px; margin-bottom: 13px; }
.field > span, fieldset legend { color: #455651; font-size: 11px; font-weight: 700; }
.field input, .field select, .field textarea, select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d9e2de;
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: #fbfcfb;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #61a28e; box-shadow: 0 0 0 3px rgba(97,162,142,.1); }
.field small { color: var(--muted); font-size: 9px; }
.input-unit { position: relative; }
.input-unit b { position: absolute; right: 12px; top: 12px; color: var(--muted); font-size: 11px; }

dialog { width: min(820px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 18px; overflow-y: auto; box-shadow: 0 30px 90px rgba(12,35,29,.25); }
dialog::backdrop { background: rgba(8,24,20,.62); backdrop-filter: blur(3px); }
dialog form { padding: 26px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; margin-bottom: 23px; }
.dialog-head h2 { margin: 4px 0 0; font: 800 22px "Manrope"; }
.close-dialog { border: 0; color: #72817d; background: none; font-size: 28px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 13px; }
.form-grid .wide, .type-picker.wide { grid-column: 1 / -1; }
.type-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0; margin: 5px 0 20px; border: 0; }
.type-picker legend { margin-bottom: 7px; }
.type-picker input { display: none; }
.type-picker label { padding: 12px 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); text-align: center; font-size: 11px; font-weight: 700; }
.type-picker label:has(input:checked) { border-color: #47927b; color: var(--green); background: #edf7f3; box-shadow: inset 0 0 0 1px #47927b; }
.type-picker label span { margin-right: 4px; }
.option-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0; margin: 5px 0 20px; border: 0; }
.option-picker legend { margin-bottom: 7px; }
.option-picker label { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 11px; font-weight: 700; }
.option-picker label:has(input:checked) { border-color: #47927b; color: var(--green); background: #edf7f3; }
.listing-card.seen { opacity: .68; }
.dialog-actions { justify-content: flex-end; padding-top: 16px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 17px; border-radius: 10px; color: white; background: var(--green); box-shadow: var(--shadow); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .25s; font-size: 12px; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #a94343; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(231,255,118,.18), transparent 28%),
    linear-gradient(135deg, #0f2924, #17473d);
}
.login-shell {
  width: min(440px, 100%);
  padding: 0;
}
.login-brand {
  width: fit-content;
  margin: 0 auto 18px;
}
.login-card {
  padding: 30px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 28px 80px rgba(7,24,19,.24);
}
.login-card h1 {
  margin: 5px 0 8px;
  font: 800 30px "Manrope", sans-serif;
}
.login-card > p:not(.eyebrow) {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}
.login-card code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #edf3f0;
}
.login-card .btn {
  width: 100%;
  margin-top: 4px;
}
.login-button-link { text-decoration: none; }
.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.login-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #f0c9c9;
  border-radius: 8px;
  color: #9b3737;
  background: #fff0f0;
  font-size: 12px;
  font-weight: 700;
}
.login-error.success {
  border-color: #bfe4d0;
  color: #17634c;
  background: #edf8f2;
}
.login-back {
  display: block;
  width: fit-content;
  margin: 16px auto 0;
  text-decoration: none;
}

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 210px 1fr; }
  main { padding-inline: 25px; }
  .sidebar { padding-inline: 17px; }
  .hero { grid-template-columns: 1fr .6fr; }
  .hero-copy { padding-left: 34px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  body.sidebar-open::after {
    content: "";
    position: fixed;
    z-index: 18;
    inset: 0;
    background: rgba(8,24,20,.48);
    backdrop-filter: blur(2px);
  }
  .sidebar {
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    width: min(82vw, 292px);
    max-width: 100%;
    padding: 22px 18px 18px;
    transform: translateX(-100%);
    transition: .25s ease;
    box-shadow: 18px 0 55px rgba(8,24,20,.22);
  }
  .sidebar.open { transform: none; }
  .brand { font-size: 18px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .nav { margin-top: 30px; }
  .nav-item, .nav-link { min-height: 46px; border-radius: 9px; }
  main { padding: 0 14px 40px; }
  .mobile-menu {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 10px;
    background: white;
    border: 1px solid var(--line);
  }
  .topbar {
    position: sticky;
    z-index: 12;
    top: 0;
    overflow: hidden;
    min-height: 72px;
    margin: 0 -14px 14px;
    padding: 0 14px;
    background: rgba(245,247,245,.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(19,33,30,.07);
  }
  .topbar > div:not(.top-actions) { display: none; }
  .topbar .eyebrow, .topbar h1 { display: none; }
  .top-actions {
    position: absolute;
    left: calc(100dvw - 56px);
    right: auto;
    top: 15px;
    margin-left: 0;
    gap: 8px;
  }
  .top-actions .btn-ghost { display: none; }
  .top-actions .btn-primary {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    font-size: 0;
  }
  .top-actions .btn-primary span { font-size: 16px; }
  .hero {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
    min-height: auto;
    border-radius: 16px;
  }
  .hero-copy { width: min(100%, 346px); min-width: 0; max-width: 346px; padding: 30px 22px 140px; }
  .pill { max-width: 100%; }
  .hero h2 {
    max-width: 100%;
    margin-top: 18px;
    font-size: clamp(27px, 7.8vw, 31px);
    line-height: 1.15;
    letter-spacing: -.015em;
    overflow-wrap: anywhere;
  }
  .hero-copy > p { max-width: 100%; font-size: 13px; line-height: 1.58; overflow-wrap: break-word; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 10px; }
  .hero-actions .btn { width: auto; min-height: 40px; }
  .radar-wrap { position: absolute; right: -54px; bottom: -72px; opacity: .52; }
  .radar { width: 215px; }
  .metrics, .dashboard-grid, .cards-grid, .settings-grid { grid-template-columns: 1fr; }
  .metrics { gap: 10px; margin: 14px 0; }
  .metric-card { min-height: 72px; padding: 14px; }
  .metric-card small { white-space: normal; }
  .section-intro {
    align-items: flex-start;
    gap: 14px;
    flex-direction: column;
    margin: 12px 0 18px;
  }
  .section-intro > div { min-width: 0; }
  .section-intro h2 { font-size: 25px; }
  .section-intro > div > p:last-child { font-size: 12px; line-height: 1.5; }
  .section-intro > .btn, .section-intro .btn { width: 100%; }
  .panel { border-radius: 13px; }
  .panel-head { align-items: flex-start; gap: 12px; padding: 17px 16px 12px; }
  .profile-list, .listing-list { padding-inline: 6px; }
  .profile-row, .listing-row { align-items: flex-start; gap: 10px; padding: 12px 10px; }
  .row-main strong { white-space: normal; line-height: 1.35; }
  .row-main small { line-height: 1.35; }
  .listing-row { display: grid; grid-template-columns: 32px 1fr auto; }
  .listing-row .price { grid-column: 2; }
  .listing-row .feed-link { grid-column: 3; align-self: end; }
  .profile-card { padding: 18px; border-radius: 13px; }
  .card-actions { margin: 0 -18px -18px; }
  .listing-toolbar { width: 100%; align-items: stretch; flex-direction: column; }
  .listing-toolbar .segmented, .listing-toolbar .btn { width: 100%; }
  .segmented button { flex: 1; }
  .listing-card {
    grid-template-columns: 38px 1fr;
    align-items: flex-start;
    gap: 11px;
    padding: 15px 14px 48px;
    border-radius: 12px;
  }
  .listing-source-mark { width: 38px; height: 38px; }
  .listing-body h3 { padding-right: 28px; font-size: 13px; }
  .listing-facts { gap: 7px 9px; }
  .listing-delete { position: absolute; top: 10px; right: 10px; }
  .listing-direct-url { position: absolute; left: 14px; bottom: 14px; }
  .source-section-head { align-items: flex-start; gap: 8px; flex-direction: column; }
  .source-card {
    position: relative;
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
  }
  .source-card .row-badge {
    grid-column: 2;
    width: fit-content;
  }
  .source-card .switch, .source-card .source-open, .source-card .icon-btn {
    grid-column: 2;
    justify-self: start;
  }
  .source-open { white-space: normal; }
  .settings-panel.wide { grid-column: auto; }
  .settings-panel { padding: 18px; border-radius: 13px; }
  .admin-user-row { grid-template-columns: 1fr; }
  .admin-user-row .btn { width: 100%; }
  .channel-head { align-items: flex-start; }
  .two-fields, .three-fields, .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide, .type-picker.wide { grid-column: auto; }
  .type-picker, .option-picker { grid-template-columns: 1fr; }
  dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
    border-radius: 15px;
  }
  dialog form { padding: 20px; }
  .dialog-head { gap: 14px; margin-bottom: 18px; }
  .dialog-head h2 { font-size: 20px; }
  .dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .dialog-actions .btn { width: 100%; }
  .toast { left: 14px; right: 14px; bottom: 14px; max-width: none; }
}

@media (max-width: 420px) {
  main { padding-inline: 12px; }
  .topbar { margin-inline: -12px; padding-inline: 12px; }
  .hero-copy { padding: 26px 18px 128px; }
  .hero h2 { font-size: 28px; }
  .btn { min-height: 40px; padding-inline: 13px; }
  .metric-icon { flex-basis: 36px; height: 36px; }
  .listing-row { grid-template-columns: 32px 1fr; }
  .listing-row .price, .listing-row .feed-link { grid-column: 2; }
  .source-card { grid-template-columns: 38px 1fr; padding: 13px; }
  .source-icon { width: 38px; height: 38px; }
  .login-page { padding: 16px; }
  .login-card { padding: 23px; }
  .login-card h1 { font-size: 26px; }
}
