:root {
  --paper: #f2f0e8;
  --paper-deep: #e6e3d8;
  --ink: #111111;
  --muted: #686761;
  --faint: #99978e;
  --line: #b8b5aa;
  --line-dark: #111111;
  --red: #f1261c;
  --blue: #1f41ff;
  --yellow: #ffd400;
  --header: 72px;
  --utility: 58px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.45 "Archivo", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: miter; }
::selection { background: var(--yellow); color: var(--ink); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--paper-deep); }
::-webkit-scrollbar-thumb { background: var(--ink); }

.skip-link { position: fixed; left: 16px; top: -70px; z-index: 1200; padding: 10px 14px; background: var(--blue); color: #fff; font-weight: 800; text-decoration: none; }
.skip-link:focus { top: 16px; }

/* Shell */
.app-shell { height: 100vh; height: 100dvh; display: grid; grid-template-rows: var(--header) minmax(0, 1fr); overflow: hidden; }
.sidebar { min-width: 0; display: flex; align-items: stretch; padding: 0 clamp(18px, 2.4vw, 38px); border-bottom: 2px solid var(--ink); background: var(--paper); }
.brand { width: 172px; flex: 0 0 172px; display: flex; align-items: center; gap: 13px; padding: 0 24px 0 0; border: 0; border-right: 1px solid var(--ink); background: transparent; cursor: pointer; text-align: left; }
.logo-mark { width: 30px; height: 30px; display: block; flex: 0 0 auto; border-radius: 8%; object-fit: cover; }
.brand-copy strong { font-size: 20px; font-weight: 800; letter-spacing: -.08em; }
.primary-nav { display: flex; align-items: stretch; margin-left: 24px; }
.nav-item { position: relative; width: auto; min-height: 0; display: grid; grid-template-columns: 18px auto auto; align-items: center; gap: 8px; padding: 0 17px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700; text-align: left; }
.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { color: var(--ink); background: var(--paper-deep); }
.nav-item.active { color: var(--ink); }
.nav-item.active::after { content: ""; position: absolute; left: 17px; right: 17px; bottom: -2px; height: 7px; background: var(--red); }
.nav-item.active svg { color: var(--red); }
.nav-count { min-width: 21px; height: 19px; display: grid; place-items: center; padding: 0 5px; background: var(--ink); color: var(--paper); font: 10px/1 "IBM Plex Mono", monospace; }
.sidebar-foot { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.socket-state { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 9px/1 "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.socket-state i { width: 8px; height: 8px; background: var(--yellow); border: 1px solid var(--ink); }
.socket-state.online { color: var(--ink); }
.socket-state.online i { background: var(--blue); }
.account-button { width: 205px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 16px; align-items: center; gap: 10px; padding: 8px 0 8px 16px; border: 0; border-left: 1px solid var(--ink); background: transparent; cursor: pointer; text-align: left; }
.account-button:hover { background: var(--yellow); }
.account-button > span:nth-child(2) { min-width: 0; }
.account-button strong, .account-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-button strong { font-size: 11px; }
.account-button small { color: var(--muted); font-size: 9px; }
.account-button svg { width: 14px; }
.account-avatar { width: 34px; height: 34px; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 800; }

.workspace { min-width: 0; min-height: 0; display: grid; grid-template-rows: var(--utility) minmax(0, 1fr); overflow: hidden; background: var(--paper); }
.topbar { z-index: 20; display: flex; align-items: center; gap: 18px; padding: 0 clamp(18px, 2.4vw, 38px); border-bottom: 1px solid var(--ink); background: var(--paper); }
.mobile-brand { display: none; }
.global-search { position: relative; width: min(720px, 72%); height: 100%; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 0 0 0 14px; border-left: 7px solid var(--blue); }
.global-search > svg { width: 18px; }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.global-search input::placeholder { color: var(--muted); }
kbd { padding: 3px 7px; border: 1px solid var(--ink); background: var(--paper); font: 9px/1 "IBM Plex Mono", monospace; }
.search-results { position: absolute; top: calc(100% + 1px); left: -7px; right: 0; max-height: 430px; display: none; overflow: auto; padding: 0; border: 2px solid var(--ink); background: var(--paper); box-shadow: 12px 12px 0 rgba(17,17,17,.16); z-index: 100; }
.search-results.open { display: block; }
.search-result { width: 100%; min-height: 58px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--yellow); }
.search-result img, .search-fallback { width: 36px; height: 36px; object-fit: cover; }
.search-fallback { display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 18px; }
.search-result strong, .search-result small { display: block; }
.search-result strong { font-size: 12px; }
.search-result small { color: var(--muted); font-size: 10px; }
.search-result code { color: var(--blue); font: 9px "IBM Plex Mono", monospace; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--ink); background: transparent; cursor: pointer; }
.icon-button:hover { background: var(--ink); color: var(--paper); }
.icon-button svg { width: 17px; }
.x-link { color: var(--ink); font: 700 13px/1 "IBM Plex Mono", monospace; text-decoration: none; }
.content { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 40px clamp(20px, 3.5vw, 58px) 70px; }
.mobile-nav { display: none; }

/* Shared typography and controls */
.page-head { position: relative; min-height: 178px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; gap: 0 16px; margin-bottom: 32px; padding: 20px 0 24px; border-top: 8px solid var(--red); border-bottom: 2px solid var(--ink); overflow: hidden; }
.page-head::after { content: attr(data-page-index); position: absolute; right: -8px; bottom: -25px; color: var(--ink); font: 800 clamp(110px, 12vw, 176px)/.8 "Archivo", sans-serif; letter-spacing: -.12em; opacity: .09; pointer-events: none; }
.page-head > div:first-child { grid-column: 1 / span 8; position: relative; z-index: 1; }
.page-actions { grid-column: 9 / -1; position: relative; z-index: 1; display: flex; justify-content: flex-end; gap: 8px; }
.page-kicker, .eyebrow { color: var(--blue); font: 600 9px/1 "IBM Plex Mono", monospace; letter-spacing: .14em; text-transform: uppercase; }
.page-head h1 { max-width: 760px; margin: 18px 0 8px; font-size: clamp(43px, 5vw, 76px); font-weight: 800; font-stretch: 75%; line-height: .84; letter-spacing: -.075em; text-transform: uppercase; }
.page-head p { max-width: 560px; margin: 15px 0 0; color: var(--muted); font-size: 13px; }
.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 700; }
.button:hover { background: var(--ink); color: var(--paper); }
.button.primary { border-color: var(--red); background: var(--red); color: #fff; }
.button.primary:hover { border-color: var(--ink); background: var(--ink); }
.button.danger { color: var(--red); }
.button svg { width: 14px; height: 14px; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.segmented { display: flex; align-items: stretch; border: 1px solid var(--ink); background: var(--paper); }
.segmented button { min-height: 37px; padding: 0 12px; border: 0; border-right: 1px solid var(--ink); background: transparent; color: var(--muted); cursor: pointer; font: 600 10px "IBM Plex Mono", monospace; }
.segmented button:last-child { border-right: 0; }
.segmented button:hover { background: var(--paper-deep); color: var(--ink); }
.segmented button.active { background: var(--blue); color: #fff; }
.control-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.result-count { color: var(--muted); font: 500 9px "IBM Plex Mono", monospace; }
.inline-search { width: min(320px, 100%); height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid var(--ink); background: transparent; }
.inline-search:focus-within { border-bottom: 4px solid var(--blue); }
.inline-search svg { width: 15px; }
.inline-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }

/* Index and cards */
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; border: 2px solid var(--ink); background: var(--paper); }
.metric { min-height: 112px; padding: 16px 18px; border-right: 1px solid var(--ink); }
.metric:last-child { border-right: 0; }
.metric:nth-child(3) { background: var(--yellow); }
.metric span { color: var(--muted); font: 500 9px/1.3 "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
.metric strong { display: block; margin-top: 14px; font: 600 31px/1 "IBM Plex Mono", monospace; letter-spacing: -.06em; }
.metric small { display: block; margin-top: 8px; color: var(--muted); font-size: 9px; }
.metric .up { color: var(--red); }
.data-panel { border: 1px solid var(--ink); background: var(--paper); overflow: hidden; }
.data-head, .signal-row { display: grid; grid-template-columns: minmax(230px, 1.4fr) minmax(90px, .55fr) minmax(100px, .6fr) minmax(90px, .55fr) 96px; align-items: center; gap: 14px; }
.data-head { min-height: 42px; padding: 0 15px; border-bottom: 2px solid var(--ink); background: var(--ink); color: var(--paper); font: 500 8px "IBM Plex Mono", monospace; letter-spacing: .09em; text-transform: uppercase; }
.signal-row { min-height: 79px; padding: 10px 15px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s, transform .12s; }
.signal-row:last-child { border-bottom: 0; }
.signal-row:hover { background: #fff; transform: translateX(4px); }
.identity { min-width: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 12px; }
.avatar, .avatar-fallback { width: 44px; height: 44px; object-fit: cover; background: var(--paper-deep); filter: grayscale(.15) contrast(1.05); }
.avatar-fallback { display: grid; place-items: center; border: 1px solid var(--ink); color: var(--ink); font-weight: 800; }
.identity-copy { min-width: 0; }
.identity-title { min-width: 0; display: flex; align-items: center; gap: 6px; }
.identity-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.verified { color: var(--blue); font-size: 10px; }
.identity-copy small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tag-line { display: flex; gap: 4px; margin-top: 5px; overflow: hidden; }
.tag { min-height: 17px; display: inline-flex; align-items: center; padding: 0 5px; border: 1px solid var(--ink); color: var(--ink); font: 7px "IBM Plex Mono", monospace; white-space: nowrap; }
.mono-value { color: var(--ink); font: 12px "IBM Plex Mono", monospace; }
.mono-value small { color: var(--muted); font-size: 7px; }
.growth { width: max-content; padding: 4px 6px; border-left: 5px solid var(--red); color: var(--red); font: 600 9px "IBM Plex Mono", monospace; }
.growth.negative { border-color: var(--ink); color: var(--ink); }
.row-actions { display: flex; justify-content: flex-end; }
.mini-button { min-height: 29px; padding: 0 9px; border: 1px solid var(--ink); background: transparent; cursor: pointer; font-size: 9px; font-weight: 700; white-space: nowrap; }
.mini-button:hover { background: var(--ink); color: var(--paper); }
.mini-button.track { border-color: var(--red); color: var(--red); }
.mini-button.tracked { border-color: var(--line); color: var(--muted); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px; background: var(--ink); }
.profile-card { min-height: 158px; padding: 17px; background: var(--paper); cursor: pointer; transition: background .12s; }
.profile-card:hover { background: var(--yellow); }
.profile-card-top { display: flex; align-items: center; gap: 10px; }
.profile-card-top .avatar, .profile-card-top .avatar-fallback { width: 39px; height: 39px; }
.profile-card-top .identity-copy { flex: 1; }
.profile-card p { height: 38px; overflow: hidden; margin: 16px 0 12px; color: var(--muted); font-size: 10px; }
.profile-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 9px; border-top: 1px solid var(--ink); }
.mini-stats { color: var(--muted); font: 8px "IBM Plex Mono", monospace; }
.mini-stats b { color: var(--ink); }

/* Tracker */
.tracker-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
.side-panel-card { padding: 18px; border: 1px solid var(--ink); border-top: 8px solid var(--red); background: var(--paper); }
.side-panel-card h3 { margin: 0 0 8px; font-size: 21px; line-height: 1; letter-spacing: -.04em; text-transform: uppercase; }
.side-panel-card > p { margin: 0 0 18px; color: var(--muted); font-size: 10px; }
.quick-add { display: flex; gap: 6px; }
.quick-add input { min-width: 0; width: 100%; height: 39px; padding: 0 9px; border: 1px solid var(--ink); outline: 0; background: #fff; color: var(--ink); }
.tracking-card { min-height: 72px; display: grid; grid-template-columns: minmax(190px, 1fr) auto auto; align-items: center; gap: 16px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.tracking-card:last-child { border-bottom: 0; }
.tracking-card:hover { background: #fff; }
.filter-toggles { display: flex; gap: 5px; }
.filter-chip { min-height: 26px; padding: 0 7px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font: 7px "IBM Plex Mono", monospace; text-transform: uppercase; }
.filter-chip.on { border-color: var(--blue); background: var(--blue); color: #fff; }
.kv-list { display: grid; gap: 0; margin-top: 16px; border-top: 1px solid var(--ink); }
.kv-list div { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.kv-list b { color: var(--ink); font: 600 9px "IBM Plex Mono", monospace; text-align: right; overflow-wrap: anywhere; }

/* States and scan */
.empty-state, .loading-state, .error-state { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 38px; text-align: center; color: var(--muted); }
.empty-state svg, .error-state svg { width: 34px; height: 34px; color: var(--blue); }
.empty-state h3, .error-state h3 { margin: 16px 0 5px; color: var(--ink); font-size: 18px; text-transform: uppercase; }
.empty-state p, .error-state p { max-width: 350px; margin: 0; font-size: 10px; }
.loading-state i { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--red); animation: spin .7s linear infinite; }
.loading-state span { margin-top: 12px; font: 9px "IBM Plex Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
@keyframes spin { to { transform: rotate(1turn); } }

.scanner-hero { position: relative; min-height: 340px; display: grid; place-items: center; padding: 40px; overflow: hidden; border: 2px solid var(--ink); background: var(--yellow); }
.scanner-hero::before { content: ""; position: absolute; inset: 0; opacity: .2; background-image: linear-gradient(var(--ink) 1px, transparent 1px), linear-gradient(90deg, var(--ink) 1px, transparent 1px); background-size: 38px 38px; }
.scan-box { position: relative; z-index: 1; width: min(700px, 100%); }
.scan-box > svg { width: 42px; height: 42px; margin-bottom: 30px; color: var(--red); stroke-width: 2.4; }
.scan-box h2 { margin: 0; font-size: clamp(42px, 5vw, 68px); font-weight: 800; font-stretch: 75%; line-height: .85; letter-spacing: -.07em; text-transform: uppercase; }
.scan-box p { max-width: 500px; margin: 17px 0 28px; font-size: 11px; }
.scan-input { min-height: 58px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 0 8px 0 16px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 9px 9px 0 var(--ink); }
.scan-input svg { width: 18px; color: var(--blue); }
.scan-input input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.scan-result { margin-top: 16px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr); gap: 16px; }
.detail-card { padding: 19px; border: 1px solid var(--ink); background: var(--paper); }
.detail-card:first-child { border-top: 8px solid var(--blue); }
.detail-identity { display: flex; align-items: center; gap: 14px; }
.detail-identity .avatar, .detail-identity .avatar-fallback { width: 60px; height: 60px; }
.detail-card h2 { margin: 0; font-size: 24px; line-height: 1; text-transform: uppercase; }
.handle { color: var(--blue); font: 10px "IBM Plex Mono", monospace; }
.detail-description { margin: 18px 0; color: var(--muted); font-size: 11px; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--ink); }
.detail-stats div { padding: 13px 7px 0; }
.detail-stats span, .detail-stats b { display: block; }
.detail-stats span { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.detail-stats b { margin-top: 4px; font: 600 16px "IBM Plex Mono", monospace; }

/* Deep scan loader */
.intel-loader { min-height: min(690px, calc(100dvh - 150px)); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; border: 2px solid var(--ink); background: var(--paper); }
.intel-loader > header { min-height: 55px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 2px solid var(--ink); }
.intel-loader > header code { color: var(--blue); font: 10px "IBM Plex Mono", monospace; }
.intel-loader-body { position: relative; min-height: 350px; display: grid; grid-template-columns: 210px minmax(0, 500px); align-items: center; justify-content: center; gap: 64px; padding: 50px; background-color: var(--yellow); background-image: linear-gradient(rgba(17,17,17,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(17,17,17,.12) 1px, transparent 1px); background-size: 32px 32px; }
.signal-core { position: relative; width: 190px; height: 190px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); }
.signal-core::before, .signal-core::after, .signal-core i { content: ""; position: absolute; border-radius: 50%; }
.signal-core::before { inset: 18px; border: 2px dashed var(--red); animation: orbit 8s linear infinite; }
.signal-core::after { inset: 48px; border: 2px solid var(--blue); }
.signal-core i:nth-child(1) { inset: -9px; border-top: 6px solid var(--red); border-right: 6px solid transparent; animation: orbit 2.4s linear infinite; }
.signal-core i:nth-child(2) { inset: 31px; border-bottom: 4px solid var(--blue); border-left: 4px solid transparent; animation: orbit 3.4s linear infinite reverse; }
.signal-core i:nth-child(3) { width: 9px; height: 9px; left: 22px; top: 50%; background: var(--red); }
.signal-core b { position: relative; z-index: 2; font: 800 25px "IBM Plex Mono", monospace; }
@keyframes orbit { to { transform: rotate(1turn); } }
.intel-loader-copy > span { color: var(--blue); font: 600 9px "IBM Plex Mono", monospace; letter-spacing: .14em; }
.intel-loader-copy h2 { max-width: 480px; margin: 14px 0 10px; font-size: clamp(36px, 4vw, 58px); font-weight: 800; font-stretch: 75%; line-height: .85; letter-spacing: -.07em; text-transform: uppercase; }
.intel-loader-copy p { min-height: 38px; max-width: 440px; margin: 0; font-size: 10px; }
.intel-progress { height: 7px; margin-top: 30px; border: 1px solid var(--ink); background: var(--paper); }
.intel-progress i { display: block; width: 12%; height: 100%; background: var(--red); transition: width .45s ease; }
.intel-progress-meta { display: flex; justify-content: space-between; margin-top: 8px; font: 8px "IBM Plex Mono", monospace; }
.intel-steps { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); }
.intel-steps article { min-height: 112px; display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: 9px; align-content: center; padding: 14px; border-right: 1px solid var(--ink); opacity: .42; }
.intel-steps article:last-child { border-right: 0; }
.intel-steps article.active { background: var(--blue); color: #fff; opacity: 1; }
.intel-steps article.done { background: var(--paper-deep); opacity: .8; }
.intel-steps article > span, .intel-steps article > i { font: 8px "IBM Plex Mono", monospace; }
.intel-steps article b, .intel-steps article small { display: block; }
.intel-steps article b { font-size: 9px; text-transform: uppercase; }
.intel-steps article small { margin-top: 4px; font-size: 8px; line-height: 1.35; }
.intel-steps article > i { grid-column: 2; font-style: normal; letter-spacing: .08em; }

/* Project */
.project-page { max-width: 1360px; margin: 0 auto; }
.project-back { margin: 0 0 14px; padding: 0; border: 0; background: transparent; color: var(--blue); cursor: pointer; font: 600 10px "IBM Plex Mono", monospace; text-transform: uppercase; }
.project-back:hover { color: var(--red); }
.project-banner { position: relative; height: 205px; overflow: hidden; border: 2px solid var(--ink); background: var(--blue); }
.project-banner > img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.2); mix-blend-mode: luminosity; opacity: .48; }
.project-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(31,65,255,.78), transparent 60%); }
.project-banner-grid { position: absolute; inset: 0; z-index: 1; opacity: .3; background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px); background-size: 42px 42px; }
.contract-badge { position: absolute; z-index: 3; right: 18px; top: 18px; min-width: 100px; padding: 10px 12px; border: 2px solid var(--ink); background: var(--yellow); }
.contract-badge span, .contract-badge b { display: block; }
.contract-badge span { font: 8px "IBM Plex Mono", monospace; text-transform: uppercase; }
.contract-badge b { margin-top: 3px; font: 600 22px "IBM Plex Mono", monospace; }
.project-profile-head { min-height: 160px; display: grid; grid-template-columns: 106px minmax(0, 1fr) auto; gap: 18px; align-items: start; padding: 0 20px 20px; border: 2px solid var(--ink); border-top: 0; background: var(--paper); }
.project-avatar-wrap { position: relative; z-index: 3; margin-top: -42px; }
.project-avatar-wrap .avatar, .project-avatar-wrap .avatar-fallback { width: 102px; height: 102px; border: 5px solid var(--paper); outline: 2px solid var(--ink); font-size: 26px; }
.project-main { min-width: 0; padding-top: 16px; }
.project-main h1 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.05em; text-transform: uppercase; }
.project-main > a { display: inline-block; margin-top: 4px; color: var(--blue); font: 10px "IBM Plex Mono", monospace; text-decoration: none; }
.project-main > p { max-width: 720px; margin: 13px 0 10px; color: var(--muted); font-size: 11px; }
.project-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 9px; }
.project-meta b { color: var(--ink); font: 600 12px "IBM Plex Mono", monospace; }
.project-meta i { font-style: normal; }
.project-actions { display: flex; gap: 7px; padding-top: 18px; }
.project-actions a { text-decoration: none; }
.project-columns { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; margin-top: 16px; }
.project-primary, .project-aside { min-width: 0; display: grid; align-content: start; gap: 16px; }
.project-section { overflow: hidden; border: 1px solid var(--ink); background: var(--paper); }
.project-section-head { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-bottom: 2px solid var(--ink); }
.project-section-head h2 { margin: 5px 0 0; font-size: 18px; line-height: 1; text-transform: uppercase; }
.project-section-head p { margin: 5px 0 0; color: var(--muted); font-size: 8px; }
.project-tabs { display: flex; border: 1px solid var(--ink); }
.project-tabs button { min-height: 34px; padding: 0 10px; border: 0; border-right: 1px solid var(--ink); background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; }
.project-tabs button:last-child { border-right: 0; }
.project-tabs button.active { background: var(--red); color: #fff; }
.project-table-controls { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 13px; border-bottom: 1px solid var(--ink); }
.project-table-controls .inline-search { width: 230px; }
.project-followers-table { width: 100%; overflow-x: auto; }
.project-follower-head, .project-follower-row { min-width: 650px; display: grid; grid-template-columns: minmax(190px, 1fr) 80px 104px 85px 58px; align-items: center; gap: 10px; }
.project-follower-head { min-height: 37px; padding: 0 13px; border-bottom: 1px solid var(--ink); background: var(--ink); color: var(--paper); font: 7px "IBM Plex Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
.project-follower-row { min-height: 67px; padding: 8px 13px; border-bottom: 1px solid var(--line); cursor: pointer; }
.project-follower-row:last-child { border-bottom: 0; }
.project-follower-row:hover { background: var(--yellow); }
.project-follower-row .identity { grid-template-columns: 38px minmax(0, 1fr); }
.project-follower-row .avatar, .project-follower-row .avatar-fallback { width: 38px; height: 38px; }
.project-follower-row .mono-value { font-size: 9px; }
.project-x-link { color: inherit; text-decoration: none; }
.watch-star { width: 30px; height: 30px; padding: 0; border: 1px solid var(--ink); background: transparent; cursor: pointer; }
.watch-star:hover, .watch-star.active { background: var(--yellow); color: var(--ink); }
.chart-range-status { min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 14px; border-bottom: 1px solid var(--ink); font: 8px "IBM Plex Mono", monospace; }
.chart-range-status span { padding: 3px 6px; background: var(--blue); color: #fff; }
.chart-range-status i { margin-left: auto; color: var(--muted); font-style: normal; }
.project-chart { position: relative; height: 290px; padding: 14px 14px 28px; background-image: linear-gradient(rgba(17,17,17,.06) 1px, transparent 1px); background-size: 100% 25%; }
.project-chart svg { width: 100%; height: 100%; overflow: visible; }
.project-chart .chart-grid line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis { position: absolute; left: 20px; right: 20px; bottom: 10px; display: flex; justify-content: space-between; color: var(--muted); font: 7px "IBM Plex Mono", monospace; }
.chart-legend { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); }
.chart-legend span { min-height: 58px; padding: 10px 12px; border-right: 1px solid var(--ink); color: var(--muted); font-size: 8px; }
.chart-legend span:last-child { border-right: 0; }
.chart-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; }
.chart-legend b { display: block; margin-top: 5px; color: var(--ink); font: 600 13px "IBM Plex Mono", monospace; }
.project-chart-empty { height: 220px; display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.snapshot-chart { padding: 14px; }
.snapshot-note { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--ink); background: var(--yellow); }
.snapshot-note span { flex: 0 0 auto; color: var(--red); font: 600 8px "IBM Plex Mono", monospace; }
.snapshot-note p { margin: 0; font-size: 9px; }
.snapshot-points { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 10px; border: 1px solid var(--ink); }
.snapshot-points > div { min-height: 80px; padding: 12px; border-right: 1px solid var(--ink); }
.snapshot-points > div:last-child { border-right: 0; }
.snapshot-points span, .snapshot-points b, .snapshot-points small { display: block; }
.snapshot-points span { color: var(--muted); font-size: 8px; }
.snapshot-points b { margin-top: 7px; font: 600 14px "IBM Plex Mono", monospace; }
.snapshot-points b i { color: var(--red); font-style: normal; }
.snapshot-points small { margin-top: 5px; color: var(--muted); font: 7px "IBM Plex Mono", monospace; }
.project-section.compact .project-section-head { min-height: 60px; border-bottom-width: 1px; }
.project-info { display: grid; }
.project-info > div { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.project-info > div:last-child { border-bottom: 0; }
.project-info span { color: var(--muted); font-size: 8px; }
.project-info b { font: 9px "IBM Plex Mono", monospace; text-align: right; }
.project-alerts article { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 9px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.project-alerts article > i { width: 8px; height: 8px; margin-top: 4px; background: var(--red); }
.project-alerts p { margin: 0; font-size: 9px; }
.project-alerts time { color: var(--muted); font: 7px "IBM Plex Mono", monospace; }
.project-mini-empty { padding: 24px 14px; color: var(--muted); font-size: 9px; text-align: center; }
.project-contracts { display: grid; gap: 6px; padding: 10px; }
.project-contracts code { padding: 9px; border-left: 5px solid var(--blue); background: var(--paper-deep); color: var(--blue); font: 8px/1.45 "IBM Plex Mono", monospace; overflow-wrap: anywhere; }

/* Modal, toast and authorization */
.modal-layer { position: fixed; inset: 0; z-index: 500; display: none; place-items: center; padding: 20px; background: rgba(17,17,17,.7); }
.modal-layer.open { display: grid; }
.modal { width: min(540px, 100%); max-height: min(700px, 90vh); overflow: auto; border: 2px solid var(--ink); background: var(--paper); box-shadow: 14px 14px 0 var(--red); }
.modal-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 2px solid var(--ink); }
.modal-head h2 { margin: 0; font-size: 20px; text-transform: uppercase; }
.modal-close { border: 0; background: transparent; color: var(--red); cursor: pointer; font-size: 27px; }
.modal-body { padding: 17px; }
.modal-body p { color: var(--muted); font-size: 10px; }
.modal-body textarea { width: 100%; min-height: 210px; resize: vertical; padding: 11px; border: 1px solid var(--ink); outline: 0; background: #fff; color: var(--ink); font: 11px/1.6 "IBM Plex Mono", monospace; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 17px; border-top: 1px solid var(--ink); }
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 600; display: grid; gap: 8px; }
.toast { width: min(340px, calc(100vw - 36px)); padding: 12px 14px; border: 2px solid var(--ink); border-left: 9px solid var(--blue); background: var(--paper); box-shadow: 7px 7px 0 rgba(17,17,17,.2); font-size: 10px; animation: toast-in .2s ease-out; }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

.auth-gate { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: stretch; padding: clamp(18px, 4vw, 62px); overflow: auto; background: var(--paper); }
.auth-gate::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .16; background-image: linear-gradient(var(--ink) 1px, transparent 1px), linear-gradient(90deg, var(--ink) 1px, transparent 1px); background-size: 72px 72px; }
.auth-card { position: relative; z-index: 1; width: min(1240px, 100%); min-height: min(720px, calc(100dvh - 8vw)); display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(370px, .72fr); margin: auto; overflow: hidden; border: 2px solid var(--ink); background: var(--paper); box-shadow: 18px 18px 0 var(--ink); }
.auth-context { position: relative; min-width: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 34px 40px 0; overflow: hidden; border-right: 2px solid var(--ink); background: var(--yellow); }
.auth-context::after { content: "31"; position: absolute; right: -12px; top: 50%; transform: translateY(-50%); color: var(--ink); font: 800 clamp(240px, 27vw, 430px)/.7 "Archivo", sans-serif; letter-spacing: -.16em; opacity: .08; }
.auth-lockup { position: relative; z-index: 1; height: 32px; display: flex; align-items: center; }
.auth-lockup > span { margin-left: 12px; font-size: 18px; font-weight: 800; letter-spacing: -.06em; }
.auth-lockup > small { margin-left: auto; font: 8px "IBM Plex Mono", monospace; letter-spacing: .14em; }
.auth-brand { width: 30px; height: 30px; }
.auth-thesis { position: relative; z-index: 1; align-self: center; margin-top: 20px; }
.auth-kicker { color: var(--blue); font: 600 9px "IBM Plex Mono", monospace; letter-spacing: .15em; }
.auth-thesis h2 { max-width: 850px; margin: 26px 0 34px; font-size: clamp(46px, 5.25vw, 80px); font-weight: 800; font-stretch: 70%; line-height: .94; letter-spacing: -.065em; text-transform: uppercase; text-wrap: balance; }
.auth-thesis p { max-width: 500px; margin: 0; font-size: clamp(13px, 1.2vw, 16px); line-height: 1.5; }
.auth-capabilities { display: flex; flex-wrap: wrap; gap: 10px 26px; max-width: 700px !important; font-family: "IBM Plex Mono", monospace; font-size: clamp(11px, 1vw, 14px) !important; font-weight: 600; text-transform: uppercase; }
.auth-capabilities span { display: inline-flex; align-items: center; gap: 10px; }
.auth-capabilities span::before { width: 7px; height: 7px; background: var(--red); content: ""; }
.auth-tape { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); margin-inline: -40px; border-top: 2px solid var(--ink); background: var(--paper); }
.auth-tape > div { min-height: 94px; display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 8px; padding: 14px 22px; border-right: 1px solid var(--ink); }
.auth-tape > div:last-child { border-right: 0; }
.auth-tape span { grid-column: 1 / -1; font: 8px "IBM Plex Mono", monospace; letter-spacing: .1em; }
.auth-tape b { font: 600 19px "IBM Plex Mono", monospace; }
.auth-tape i { align-self: center; color: var(--red); font: 600 8px "IBM Plex Mono", monospace; }
.auth-panel { min-width: 0; display: flex; flex-direction: column; padding: 32px 34px 26px; background: var(--paper); }
.auth-panel-head { display: flex; justify-content: space-between; padding-bottom: 20px; border-bottom: 2px solid var(--ink); font: 8px "IBM Plex Mono", monospace; letter-spacing: .1em; }
.auth-panel-head i { color: var(--red); font-style: normal; }
.auth-privy-entry { display: grid; gap: 16px; margin: auto 0; }
.auth-privy-entry[hidden] { display: none; }
.privy-button { width: 100%; min-height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border: 2px solid var(--ink); background: var(--red); color: #fff; cursor: pointer; font-size: 14px; font-weight: 800; }
.privy-button:hover { background: var(--ink); }
.privy-button svg { width: 18px; }
.auth-privy-entry > small { font: 8px "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
#auth-status { min-height: 20px; margin: 0; color: var(--red); font-size: 10px; }
.auth-panel-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 22px; border-top: 1px solid var(--ink); font: 7px "IBM Plex Mono", monospace; letter-spacing: .05em; text-transform: uppercase; }
.auth-panel-foot a { color: var(--blue); font-weight: 600; text-decoration: none; }
.auth-panel-foot a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1180px) {
  .brand { width: 118px; flex-basis: 118px; }
  .nav-item { padding-inline: 11px; }
  .nav-item.active::after { left: 11px; right: 11px; }
  .account-button { width: 160px; }
  .socket-state span { display: none; }
}

@media (max-width: 1020px) {
  .tracker-layout, .detail-grid, .project-columns { grid-template-columns: 1fr; }
  .tracker-layout > .side-panel-card { order: -1; }
  .project-aside { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .account-button { width: 52px; grid-template-columns: 34px; padding-left: 10px; border-left: 0; }
  .account-button > span:nth-child(2), .account-button > svg { display: none; }
  .auth-card { grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); }
}

@media (max-width: 820px) {
  .auth-gate { padding: 0; }
  .auth-card { min-height: 100dvh; grid-template-columns: 1fr; border: 0; box-shadow: none; overflow: auto; }
  .auth-context { min-height: 48dvh; padding: 24px 24px 0; border-right: 0; border-bottom: 2px solid var(--ink); }
  .auth-lockup > small { display: none; }
  .auth-thesis { padding-block: 48px; }
  .auth-thesis h2 { margin: 20px 0 28px; font-size: clamp(43px, 11vw, 66px); line-height: .98; }
  .auth-thesis p { max-width: 430px; font-size: 12px; }
  .auth-capabilities { gap: 8px 18px; }
  .auth-tape { margin-inline: -24px; }
  .auth-tape > div { min-height: 72px; padding: 10px 14px; }
  .auth-tape b { font-size: 14px; }
  .auth-panel { min-height: 52dvh; padding: 27px 24px 24px; }
  .auth-privy-entry { margin-block: 60px; }
}

@media (max-width: 760px) {
  :root { --utility: 60px; }
  .app-shell { height: calc(100dvh - 64px); display: block; }
  .sidebar { display: none; }
  .workspace { height: 100%; }
  .topbar { padding: 0 14px; gap: 10px; }
  .mobile-brand { display: flex; align-items: center; gap: 7px; font-size: 12px; }
  .mobile-brand .logo-mark { width: 22px; height: 22px; }
  .global-search { width: auto; flex: 1; border-left-width: 4px; }
  .global-search kbd { display: none; }
  .content { padding: 26px 14px 40px; }
  .mobile-nav { position: fixed; z-index: 100; left: 0; right: 0; bottom: 0; height: 64px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); background: var(--paper); }
  .mobile-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 8px; }
  .mobile-nav button:last-child { border-right: 0; }
  .mobile-nav svg { width: 18px; height: 18px; }
  .mobile-nav button.active { background: var(--red); color: #fff; }
  .page-head { min-height: 180px; margin-bottom: 24px; padding-top: 16px; }
  .page-head > div:first-child { grid-column: 1 / span 10; }
  .page-head h1 { margin-top: 14px; font-size: clamp(40px, 13vw, 58px); }
  .page-head p { max-width: 82%; font-size: 10px; }
  .page-actions { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; margin-top: 18px; }
  .page-actions .button span { display: none; }
  .page-head:has(.page-actions) { min-height: 230px; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric { min-height: 96px; padding: 14px; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
  .metric strong { font-size: 24px; }
  .data-head { display: none; }
  .signal-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding-inline: 11px; transform: none !important; }
  .signal-row > :nth-child(2), .signal-row > :nth-child(3) { display: none; }
  .row-actions { grid-column: 2; grid-row: 1; }
  .signal-row > .growth { grid-column: 1; margin-top: -15px; margin-left: 56px; }
  .control-row { align-items: stretch; flex-direction: column; }
  .inline-search { width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .tracking-card { grid-template-columns: minmax(0, 1fr) auto; }
  .filter-toggles { grid-column: 1 / -1; overflow-x: auto; }
  .scanner-hero { min-height: 410px; padding: 28px 18px; }
  .scan-box h2 { font-size: 48px; }
  .scan-input { grid-template-columns: 20px minmax(0, 1fr); height: auto; padding: 10px 12px; }
  .scan-input .button { grid-column: 1 / -1; width: 100%; }
  .detail-stats { grid-template-columns: repeat(3, 1fr); }
  .project-banner { height: 135px; }
  .project-profile-head { grid-template-columns: 76px minmax(0, 1fr); padding: 0 12px 15px; }
  .project-avatar-wrap .avatar, .project-avatar-wrap .avatar-fallback { width: 74px; height: 74px; border-width: 3px; }
  .project-main { padding-top: 10px; }
  .project-main h1 { font-size: 19px; }
  .project-main > p, .project-meta { margin-left: -92px; }
  .project-main > p { margin-top: 24px; }
  .project-actions { grid-column: 1 / -1; padding-top: 5px; }
  .project-actions .button { flex: 1; }
  .project-section-head { align-items: flex-start; flex-direction: column; }
  .project-tabs { width: 100%; }
  .project-tabs button { flex: 1; }
  .project-table-controls { align-items: stretch; flex-direction: column; }
  .project-table-controls .inline-search { width: 100%; }
  .project-follower-head { display: none; }
  .project-follower-row { min-width: 0; grid-template-columns: minmax(0, 1fr) auto; }
  .project-follower-row > .mono-value:nth-of-type(2), .project-follower-row > .mono-value:nth-of-type(3) { display: none; }
  .project-follower-row .watch-star { grid-column: 2; grid-row: 1; }
  .project-aside { grid-template-columns: 1fr; }
  .chart-legend { grid-template-columns: repeat(2, 1fr); }
  .chart-legend span:nth-child(2) { border-right: 0; }
  .chart-legend span:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
  .project-chart { height: 230px; }
  .chart-range-status { align-items: flex-start; flex-wrap: wrap; padding-block: 9px; }
  .chart-range-status i { width: 100%; margin-left: 0; }
  .snapshot-note { align-items: flex-start; flex-direction: column; }
  .snapshot-points { grid-template-columns: repeat(2, 1fr); }
  .snapshot-points > div:nth-child(2) { border-right: 0; }
  .snapshot-points > div:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
  .intel-loader { min-height: calc(100dvh - 120px); }
  .intel-loader-body { min-height: 430px; grid-template-columns: 1fr; gap: 28px; padding: 34px 20px; text-align: center; }
  .signal-core { width: 135px; height: 135px; margin: auto; }
  .intel-loader-copy p { margin-inline: auto; }
  .intel-steps { grid-template-columns: 1fr 1fr; }
  .intel-steps article { min-height: 100px; }
  .intel-steps article:nth-child(2) { border-right: 0; }
  .intel-steps article:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
  .auth-tape { grid-template-columns: repeat(2, 1fr); }
  .auth-tape > div:nth-child(2) { border-right: 0; }
  .auth-tape > div:nth-child(3) { display: none; }
  .toast-stack { bottom: 78px; }
}

@media (max-width: 420px) {
  .topbar-actions .icon-button:not(.x-link) { display: none; }
  .page-head p { display: none; }
  .page-head { min-height: 158px; }
  .page-head:has(.page-actions) { min-height: 212px; }
  .segmented { max-width: 100%; overflow-x: auto; }
  .auth-thesis h2 { font-size: 43px; }
  .auth-capabilities { display: grid; }
  .auth-panel-foot { flex-wrap: wrap; }
}

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