:root {
  --app-height: 100dvh;
  --bg: #090c13;
  --bg-soft: #101522;
  --panel: #151b28;
  --panel-2: #1b2333;
  --line: #2a3448;
  --line-strong: #42506a;
  --text: #f3f5f8;
  --muted: #98a2b4;
  --primary: #8b5cf6;
  --primary-strong: #7445e8;
  --primary-soft: rgba(140, 99, 255, .13);
  --success: #38d5a3;
  --warning: #f4b84a;
  --danger: #ff6b78;
  --instagram: #e967aa;
  --shadow: 0 18px 48px rgba(0, 0, 0, .32);
  --radius: 14px;
  --radius-lg: 20px;
  --page: 1120px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

html:not(.dark) {
  --bg: #eef1f5;
  --bg-soft: #f7f8fa;
  --panel: #ffffff;
  --panel-2: #f2f4f7;
  --line: #d9dee7;
  --line-strong: #c1c9d6;
  --text: #151922;
  --muted: #687386;
  --primary-soft: rgba(116, 72, 241, .09);
  --shadow: 0 12px 30px rgba(36, 45, 65, .1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-width: 0; background: var(--bg); scroll-behavior: smooth; }
body { min-width: 0; min-height: 100%; margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.page-width { width: min(var(--page), calc(100% - 40px)); margin-inline: auto; }

.font-sm { font-size: 14px; }
.font-md { font-size: 16px; }
.font-lg { font-size: 18px; }

/* Public landing */
.public-shell { min-height: 100vh; background: var(--bg); }
.landing-header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.landing-brand, .app-brand { display: inline-flex; align-items: center; gap: 11px; border: 0; background: transparent; padding: 0; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 39px; border: 1px solid var(--primary); border-radius: 10px; background: var(--primary); color: #fff; font-size: 1.2rem; font-weight: 900; box-shadow: 5px 5px 0 rgba(140, 99, 255, .16); }
.landing-brand > span:last-child, .app-brand > span:last-child { display: grid; gap: 1px; text-align: left; }
.landing-brand strong, .app-brand strong { letter-spacing: -.02em; }
.landing-brand small, .app-brand small { color: var(--muted); font-size: .68rem; }

.box-button, .icon-box, .filter-button, .nav-button { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--text); font-weight: 750; transition: border-color .14s ease, background .14s ease, transform .14s ease; }
.box-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; }
.box-button:hover, .box-button:focus-visible, .filter-button:hover { border-color: var(--primary); }
.box-button:active, .icon-box:active, .filter-button:active, .nav-button:active { transform: translateY(1px); }
.box-button.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.box-button.primary:hover { background: var(--primary-strong); }
.box-button.danger { border-color: rgba(255, 107, 120, .45); background: rgba(255, 107, 120, .08); color: var(--danger); }
.box-button.small { min-height: 38px; padding: 0 13px; font-size: .78rem; }
.box-button.full { width: 100%; }

.landing-hero { min-height: 610px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); align-items: center; gap: 58px; padding-block: 74px; }
.hero-copy { min-width: 0; }
.eyebrow { display: inline-block; color: var(--primary); font-size: .68rem; font-weight: 850; letter-spacing: .16em; }
.hero-copy h1 { max-width: 670px; margin: 17px 0 20px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.55rem, 6vw, 5.2rem); line-height: .98; letter-spacing: -.045em; }
.hero-copy > p { max-width: 650px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.75; }
.hero-actions { display: flex; align-items: center; gap: 18px; margin-top: 30px; }
.no-signup-note { max-width: 250px; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.trust-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 42px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.trust-row span { min-height: 72px; display: flex; align-items: center; gap: 10px; padding: 15px; border-right: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.trust-row span:last-child { border-right: 0; }
.trust-row b { color: var(--primary); font-family: Georgia, serif; font-size: 1.05rem; }

.hero-console { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--panel); box-shadow: 12px 12px 0 rgba(0, 0, 0, .12), var(--shadow); overflow: hidden; }
.console-top { min-height: 52px; display: flex; align-items: center; gap: 9px; padding: 0 17px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .1em; }
.console-top i { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(54, 207, 155, .1); }
.console-top strong { color: var(--success); }
.quality-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quality-grid article { min-height: 155px; display: flex; flex-direction: column; justify-content: center; padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quality-grid article:nth-child(2n) { border-right: 0; }
.quality-grid article:nth-last-child(-n+2) { border-bottom: 0; }
.quality-grid small { color: var(--muted); }
.quality-grid strong { margin: 10px 0 5px; font-family: Georgia, serif; font-size: 1.4rem; }
.quality-grid span { color: var(--muted); font-size: .67rem; }
.console-line { display: flex; align-items: center; gap: 13px; padding: 18px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.console-line span { width: 3px; align-self: stretch; background: var(--primary); }
.console-line p { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.55; }

.feature-section { padding-block: 90px; border-top: 1px solid var(--line); }
.section-heading { max-width: 700px; margin-bottom: 34px; }
.section-heading span { color: var(--primary); font-size: .68rem; font-weight: 850; letter-spacing: .15em; }
.section-heading h2 { margin: 12px 0 0; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.08; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature-grid article { min-height: 230px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.feature-grid b { display: inline-grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--primary); font-family: Georgia, serif; }
.feature-grid h3 { margin: 30px 0 10px; font-size: 1rem; }
.feature-grid p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.7; }

.login-section { display: grid; grid-template-columns: 1fr minmax(340px, 440px); gap: 60px; align-items: center; padding-block: 90px; border-top: 1px solid var(--line); }
.login-info h2 { max-width: 650px; margin: 12px 0 15px; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.06; }
.login-info > p { max-width: 590px; color: var(--muted); line-height: 1.7; }
.security-list { display: grid; gap: 10px; margin-top: 28px; color: var(--muted); font-size: .78rem; }
.security-list span::first-letter { color: var(--success); }
.login-card { padding: 25px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow); }
.login-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 25px; }
.login-card-head > div { display: grid; gap: 2px; }
.login-card-head small { color: var(--muted); font-size: .7rem; }
.login-card label, .stack-field, .user-create-grid label { display: grid; gap: 8px; margin-bottom: 15px; color: var(--muted); font-size: .72rem; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--bg-soft); color: var(--text); }
input, select { min-height: 46px; padding: 0 12px; }
textarea { min-height: 310px; resize: vertical; padding: 14px; line-height: 1.65; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.login-foot { display: block; margin-top: 12px; color: var(--muted); text-align: center; }
.landing-footer { min-height: 76px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.form-message { margin: 0 0 13px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: .72rem; line-height: 1.45; }
.form-message.error { border-color: rgba(255, 107, 120, .35); color: var(--danger); background: rgba(255, 107, 120, .07); }
.form-message.success { border-color: rgba(54, 207, 155, .35); color: var(--success); background: rgba(54, 207, 155, .07); }

/* Application shell */
.app-shell { height: var(--app-height); min-height: 0; overflow: hidden; background: var(--bg); }
.app-frame { width: min(100%, 820px); height: 100%; min-height: 0; margin: 0 auto; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border-inline: 1px solid var(--line); background: var(--bg); position: relative; }
.app-header { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); z-index: 20; }
.app-brand { min-width: 0; }
.header-tools { display: flex; align-items: center; gap: 7px; min-width: 0; }
.status-box { min-height: 42px; display: flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: .69rem; }
.status-box i { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.status-box i.online { background: var(--success); }
.icon-box { min-width: 54px; padding: 0 9px; font-size: .62rem; }
.user-box { min-height: 46px; display: flex; align-items: center; gap: 8px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); text-align: left; }
.user-box > span:first-child { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: var(--primary); color: #fff; font-weight: 850; }
.user-box > span:last-child { display: grid; min-width: 0; }
.user-box strong { max-width: 92px; overflow: hidden; text-overflow: ellipsis; font-size: .69rem; }
.user-box small { color: var(--muted); font-size: .58rem; text-transform: uppercase; }
.user-menu { position: fixed; top: 66px; left: 50%; z-index: 60; width: min(250px, calc(100vw - 24px)); padding: 7px; transform: translateX(calc(min(410px, 50vw) - 135px)); border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.user-menu button { width: 100%; min-height: 42px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.user-menu button:hover { background: var(--panel-2); }
.danger-text { color: var(--danger) !important; }

.app-content { min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; touch-action: pan-y; padding: 15px 15px 30px; }
.screen { min-width: 0; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 18px; }
.boxed-heading { padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.page-heading h1 { margin: 7px 0 4px; font-family: Georgia, serif; font-size: clamp(1.7rem, 5vw, 2.45rem); letter-spacing: -.025em; }
.page-heading p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }

.progress-box { position: sticky; top: 0; z-index: 15; margin-bottom: 12px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.progress-box > div:first-child { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .7rem; }
.progress-box strong { color: var(--text); }
.progress-track { height: 5px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: var(--panel-2); }
.progress-track span { display: block; width: 0; height: 100%; background: var(--primary); transition: width .15s linear; }

.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 9px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.stats-grid::-webkit-scrollbar { display: none; }
.stats-grid article { min-height: 102px; display: flex; flex-direction: column; justify-content: center; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.stats-grid span, .stats-grid small { color: var(--muted); font-size: .65rem; }
.stats-grid strong { margin: 6px 0 2px; font-family: Georgia, serif; font-size: 1.65rem; }

.tool-box, .panel-box, .selection-box, .empty-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tool-box { margin-top: 14px; padding: 15px; }
.tool-title, .panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.tool-title strong { font-size: .83rem; }
.tool-title small { color: var(--muted); font-size: .64rem; }
.search-field { min-height: 50px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); }
.search-field > span { color: var(--muted); font-size: 1.25rem; }
.search-field input { min-width: 0; min-height: 46px; flex: 1; border: 0; padding: 0; background: transparent; box-shadow: none; }
.search-field button { width: 30px; height: 30px; border: 0; border-radius: 7px; background: var(--panel-2); color: var(--muted); }
.filter-row { display: flex; gap: 7px; margin-top: 11px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-button { flex: 0 0 auto; min-height: 39px; padding: 0 14px; color: var(--muted); font-size: .7rem; }
.filter-button.active { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }

.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 2px 11px; }
.list-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.45rem; }
.list-heading p { margin: 3px 0 0; color: var(--muted); font-size: .67rem; }
.list-actions { display: flex; gap: 7px; }
.list-actions .box-button { min-height: 40px; padding: 0 12px; font-size: .69rem; }
.selection-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 10px 12px; }
.selection-box strong { font-size: .73rem; }
.selection-box button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-soft); }

.cards-list { display: grid; gap: 12px; min-width: 0; }
.profile-card { position: relative; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.profile-card::before { content: ""; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 3px; border-radius: 0 4px 4px 0; background: var(--status-color, var(--warning)); }
.profile-card.visited { box-shadow: inset 0 4px 0 rgba(0, 0, 0, .44); border-top-color: rgba(0, 0, 0, .58); }
.profile-card.selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, var(--panel)); }
.card-grid { --card-avatar-size: 78px; display: grid; grid-template-columns: 30px var(--card-avatar-size) minmax(0, 1fr); grid-template-areas: "number avatar main" ". details details" ". footer footer" ". error error"; column-gap: 10px; row-gap: 7px; align-items: start; }
.card-number { grid-area: number; width: 30px; height: 30px; align-self: start; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--muted); font-family: Georgia, serif; font-size: .75rem; }
.avatar-wrap { grid-area: avatar; width: var(--card-avatar-size); height: var(--card-avatar-size); align-self: start; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel-2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03); }
.avatar { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-family: Georgia, serif; font-size: 1.55rem; }
.card-main { grid-area: main; min-width: 0; min-height: var(--card-avatar-size); display: grid; align-content: start; gap: 5px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.card-title-row h3 { min-width: 0; margin: 1px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Georgia, serif; font-size: 1.08rem; }
.card-tools { display: flex; flex: 0 0 auto; gap: 5px; }
.square-action { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-soft); color: var(--muted); }
.square-action:hover { border-color: var(--primary); color: var(--text); }
.square-action.active { color: var(--warning); }
.square-action.ig { color: var(--instagram); }
.square-action svg { width: 17px; height: 17px; }
.username-row { min-width: 0; display: flex; align-items: center; gap: 6px; min-height: 25px; margin: 0; }
.username-link { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0; border: 0; border-bottom: 1px dashed var(--line-strong); border-radius: 0; outline: 0; background: transparent; color: var(--muted); font-size: .76rem; text-align: left; appearance: none; }
.username-link.available { color: var(--text); }
.username-link:hover { color: var(--instagram); border-color: var(--instagram); }
.username-link, .uid-app-link { -webkit-appearance: none; appearance: none; box-shadow: none; }
.username-link:focus-visible, .uid-app-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.detail-grid { grid-area: details; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; margin: 0; }
.detail-box { min-width: 0; min-height: 48px; display: grid; grid-template-columns: minmax(0, 1fr) 27px; grid-template-rows: auto minmax(0, 1fr); column-gap: 6px; align-items: center; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); }
.detail-box label { grid-column: 1 / -1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: .52rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.detail-value, .uid-app-link { grid-column: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; }
.uid-app-link { padding: 0; border: 0; border-radius: 0; outline: 0; background: transparent; color: var(--text); font-weight: 800; text-align: left; appearance: none; }
.uid-app-link:hover { color: var(--primary); }
.mini-copy { width: 27px; height: 27px; min-height: 27px; flex: 0 0 27px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--muted); }
.detail-box > .mini-copy { grid-column: 2; grid-row: 2; }
.mini-copy.copied { color: var(--success); border-color: var(--success); }
.card-footer { grid-area: footer; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 23px; margin-top: 6px; }
.status-chip, .metric-chip, .instagram-chip { min-height: 23px; display: inline-flex; align-items: center; gap: 5px; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: .56rem; font-weight: 800; text-transform: uppercase; }
.status-chip { color: var(--status-color, var(--warning)); }
.instagram-chip { color: var(--instagram); }
.card-error { grid-area: error; margin-top: 0; padding: 8px 9px; border: 1px solid rgba(255, 107, 120, .25); border-radius: 7px; background: rgba(255, 107, 120, .06); color: var(--danger); font-size: .65rem; line-height: 1.45; }
.card-menu { position: absolute; right: 13px; top: 54px; z-index: 8; width: 170px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel); box-shadow: var(--shadow); }
.card-menu button { width: 100%; min-height: 39px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; text-align: left; font-size: .68rem; }
.card-menu button:hover { background: var(--panel-2); }
.list-sentinel { height: 1px; }
.empty-box { min-height: 260px; display: grid; place-items: center; align-content: center; gap: 9px; padding: 28px; text-align: center; }
.empty-box strong { font-family: Georgia, serif; font-size: 1.3rem; }
.empty-box p { margin: 0 0 8px; color: var(--muted); font-size: .74rem; }

.panel-box { padding: 16px; }
.import-panel textarea { margin-top: 11px; }
.format-boxes { display: flex; gap: 7px; }
.format-boxes span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-soft); color: var(--muted); font-size: .63rem; }
.import-meta { display: flex; justify-content: space-between; margin: 8px 1px 14px; color: var(--muted); font-size: .65rem; }
.settings-panel { margin-bottom: 11px; }
.settings-panel h2, .danger-panel h2, .user-list-panel h2 { margin: 0 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.setting-row { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row > span { display: grid; gap: 3px; }
.setting-row strong { font-size: .77rem; }
.setting-row small { color: var(--muted); font-size: .62rem; }
.setting-row select { width: 120px; min-height: 40px; }
.setting-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--primary); }
.settings-note { margin: 4px 0 13px; color: var(--muted); font-size: .7rem; line-height: 1.55; }
.diagnostic-result { max-height: 280px; margin: 12px 0 0; padding: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font: .68rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.danger-panel p { color: var(--muted); font-size: .7rem; }
.user-create-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 145px auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.user-create-grid label { margin: 0; }
.user-create-grid .form-message { grid-column: 1 / -1; margin: 0; }
.user-list-panel { padding-bottom: 7px; }
.users-list { display: grid; }
.user-row { display: grid; grid-template-columns: minmax(0, 1fr) 95px 90px auto; gap: 10px; align-items: center; min-height: 66px; padding-block: 9px; border-top: 1px solid var(--line); }
.user-row:first-child { border-top: 0; }
.user-identity { min-width: 0; display: grid; gap: 3px; }
.user-identity strong { overflow: hidden; text-overflow: ellipsis; }
.user-identity small, .user-meta { color: var(--muted); font-size: .62rem; }
.role-chip { justify-self: start; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: .58rem; text-transform: uppercase; }
.user-status { color: var(--success); font-size: .64rem; }
.user-status.disabled { color: var(--danger); }
.user-actions { display: flex; justify-content: flex-end; gap: 5px; }
.user-actions button { min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-soft); font-size: .62rem; }

.bottom-nav { min-height: 72px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 7px 10px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); z-index: 20; }
.nav-button { min-width: 0; min-height: 54px; display: grid; place-items: center; align-content: center; gap: 2px; border-color: transparent; background: transparent; color: var(--muted); }
.nav-button b { font-size: 1rem; font-weight: 500; }
.nav-button span { font-size: .59rem; }
.nav-button.active { border-color: var(--line); background: var(--bg-soft); color: var(--primary); }

.compact-view .profile-card { padding: 9px; }
.compact-view .card-grid { --card-avatar-size: 60px; grid-template-columns: 27px var(--card-avatar-size) minmax(0, 1fr); gap: 8px; }
.compact-view .avatar-wrap { grid-area: avatar; width: var(--card-avatar-size); height: var(--card-avatar-size); }
.compact-view .detail-box { min-height: 34px; }
.compact-view .card-footer { margin-top: 4px; }

.toast-container { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 200; display: grid; gap: 7px; transform: translateX(-50%); pointer-events: none; }
.toast { width: min(420px, calc(100vw - 24px)); padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel); box-shadow: var(--shadow); font-size: .72rem; }
.toast.error { border-color: rgba(255, 107, 120, .55); color: var(--danger); }
.toast.success { border-color: rgba(54, 207, 155, .45); }

@media (max-width: 900px) {
  .landing-hero { grid-template-columns: 1fr; gap: 45px; padding-block: 55px; }
  .hero-console { max-width: 660px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-section { grid-template-columns: 1fr; }
  .login-card { max-width: 520px; }
  .user-create-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .page-width { width: min(100% - 26px, var(--page)); }
  .landing-header { min-height: 68px; }
  .landing-brand small { display: none; }
  .landing-hero { min-height: auto; padding-block: 44px 58px; }
  .hero-copy h1 { font-size: clamp(2.45rem, 13vw, 4rem); }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .trust-row { grid-template-columns: 1fr; }
  .trust-row span { min-height: 58px; border-right: 0; border-bottom: 1px solid var(--line); }
  .trust-row span:last-child { border-bottom: 0; }
  .feature-section, .login-section { padding-block: 60px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article { min-height: 190px; }
  .quality-grid article { min-height: 130px; padding: 17px; }
  .landing-footer { min-height: 65px; }

  .app-frame { width: 100%; border: 0; }
  .app-header { min-height: 64px; padding: 8px 10px; }
  .app-brand small, .status-box span, .user-box > span:last-child { display: none; }
  .status-box { min-width: 40px; justify-content: center; padding: 0; }
  .user-box { min-width: 42px; justify-content: center; padding: 5px; }
  .user-menu { top: 60px; right: 10px; left: auto; transform: none; }
  .app-content { padding: 12px 10px 24px; }
  .boxed-heading { padding: 16px; }
  .page-heading { align-items: flex-start; }
  .page-heading .box-button { min-height: 40px; padding: 0 12px; }
  .stats-grid { grid-template-columns: repeat(5, 112px); }
  .list-heading { align-items: flex-end; }
  .list-actions .box-button:first-child { display: none; }
  .profile-card { padding: 10px; }
  .card-grid { --card-avatar-size: 72px; grid-template-columns: 28px var(--card-avatar-size) minmax(0, 1fr); gap: 9px; }
  .card-number { width: 28px; height: 28px; }
  .avatar-wrap { grid-area: avatar; width: var(--card-avatar-size); height: var(--card-avatar-size); }
  .card-title-row h3 { font-size: 1rem; }
  .detail-box { min-height: 35px; padding: 3px 6px; }
  .detail-box label { font-size: .52rem; }
  .detail-value, .uid-app-link { font-size: .67rem; }
  .card-footer { margin-top: 5px; }
  .card-tools { gap: 4px; }
  .square-action { width: 32px; height: 32px; }
  .user-create-grid { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: minmax(0, 1fr) auto; }
  .user-row .role-chip, .user-row .user-status { grid-column: 1; }
  .user-actions { grid-column: 2; grid-row: 1 / span 3; flex-direction: column; }
}


@media (max-width: 430px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .detail-box { min-height: 47px; }
  .profile-card { }
}

@media (max-width: 370px) {
  .brand-mark { width: 35px; height: 35px; flex-basis: 35px; }
  .icon-box { min-width: 48px; }
  .page-heading h1 { font-size: 1.55rem; }
  .card-grid { --card-avatar-size: 64px; grid-template-columns: 26px var(--card-avatar-size) minmax(0, 1fr); gap: 7px; }
  .card-number { width: 27px; height: 27px; }
  .avatar-wrap { grid-area: avatar; width: var(--card-avatar-size); height: var(--card-avatar-size); }
  .card-tools .square-action:nth-child(2) { display: none; }
}


@media (max-width: 340px) {
  .detail-grid { grid-template-columns: 1fr; }
  .profile-card { }
}

@media (orientation: landscape) and (max-height: 540px) {
  .app-header { min-height: 56px; }
  .bottom-nav { min-height: 58px; }
  .nav-button { min-height: 44px; }
  .nav-button b { display: none; }
}

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


/* classic premium base theme */
body {
  background:
    radial-gradient(circle at 8% -10%, rgba(139, 92, 246, .16), transparent 30%),
    radial-gradient(circle at 100% 15%, rgba(56, 213, 163, .07), transparent 26%),
    var(--bg);
}
.public-shell, .app-shell {
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    transparent;
  background-size: 32px 32px;
}
.brand-mark, .user-box > span:first-child {
  border-color: rgba(255,255,255,.18);
  background: linear-gradient(145deg, #a479ff, var(--primary-strong));
  box-shadow: 0 10px 22px rgba(116, 69, 232, .25), 4px 4px 0 rgba(139, 92, 246, .16);
}
.landing-header, .app-header, .bottom-nav {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, #fff 4%), var(--panel));
}
.box-button, .filter-button, .icon-box, .nav-button, .user-box, .status-box {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.box-button.primary {
  background: linear-gradient(135deg, #9a70ff, var(--primary-strong));
  box-shadow: 0 10px 24px rgba(116, 69, 232, .22), inset 0 1px 0 rgba(255,255,255,.2);
}
.hero-console, .login-card, .feature-grid article, .panel-box, .tool-box, .boxed-heading, .selection-box, .empty-box {
  background: linear-gradient(145deg, color-mix(in srgb, var(--panel) 96%, #fff 4%), var(--panel));
  box-shadow: 0 12px 30px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.025);
}
.boxed-heading {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--primary) 25%, var(--line));
}
.boxed-heading::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  right: -55px;
  top: -70px;
  border: 1px solid rgba(139,92,246,.17);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(139,92,246,.035), 0 0 0 45px rgba(139,92,246,.018);
  pointer-events: none;
}
.stats-grid article {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--panel) 95%, #fff 5%), var(--panel));
  box-shadow: 0 10px 24px rgba(0,0,0,.13), inset 0 1px 0 rgba(255,255,255,.025);
}
.stats-grid article::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent 82%);
}
.stats-grid article:nth-child(2)::before { background: linear-gradient(90deg, var(--success), transparent 82%); }
.stats-grid article:nth-child(3)::before { background: linear-gradient(90deg, #36b9ed, transparent 82%); }
.stats-grid article:nth-child(4)::before { background: linear-gradient(90deg, var(--instagram), transparent 82%); }
.stats-grid article:nth-child(5)::before { background: linear-gradient(90deg, var(--danger), transparent 82%); }
.progress-box {
  border-color: color-mix(in srgb, var(--primary) 44%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--panel) 95%, var(--primary) 5%), var(--panel));
}
.progress-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; color: var(--muted); font-size: .7rem; }
.progress-stop { min-height: 30px; padding: 0 10px; border: 1px solid rgba(255,107,120,.45); border-radius: 7px; background: rgba(255,107,120,.08); color: var(--danger); font-size: .62rem; font-weight: 800; }
.progress-track { height: 6px; }
.progress-track span { background: linear-gradient(90deg, var(--primary), #b79aff); }
.profile-card {
  border-color: color-mix(in srgb, var(--line) 92%, var(--primary) 8%);
  background: linear-gradient(145deg, color-mix(in srgb, var(--panel) 96%, #fff 4%), var(--panel));
  box-shadow: 0 11px 26px rgba(0,0,0,.17), inset 0 1px 0 rgba(255,255,255,.025);
}
.profile-card.visited { box-shadow: inset 0 4px 0 rgba(0,0,0,.46), 0 11px 26px rgba(0,0,0,.17); }
.profile-card.selected { box-shadow: 0 0 0 2px var(--primary-soft), 0 12px 28px rgba(0,0,0,.19); }
.avatar-wrap {
  padding: 2px;
  border: 0;
  background: linear-gradient(145deg, var(--primary), #36c5d8 58%, var(--success));
  box-shadow: 0 8px 18px rgba(0,0,0,.24);
}
.avatar, .avatar-fallback { border-radius: 10px; background: var(--panel-2); }
.detail-box, .search-field, input, textarea, select {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-soft) 96%, #fff 4%), var(--bg-soft));
}
.detail-box { box-shadow: inset 0 1px 0 rgba(255,255,255,.02); }
.card-number, .square-action, .mini-copy {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-soft) 94%, #fff 6%), var(--bg-soft));
}
.status-chip, .metric-chip, .instagram-chip, .role-chip {
  background: rgba(255,255,255,.018);
}
.user-row { padding-inline: 6px; border-radius: 9px; }
.user-row:hover { background: rgba(139,92,246,.035); }
.bottom-nav { box-shadow: 0 -10px 28px rgba(0,0,0,.2); }
.nav-button.active {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  background: linear-gradient(180deg, rgba(139,92,246,.13), rgba(139,92,246,.055));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
html:not(.dark) body {
  background:
    radial-gradient(circle at 8% -10%, rgba(116,72,241,.11), transparent 30%),
    radial-gradient(circle at 100% 15%, rgba(54,207,155,.06), transparent 26%),
    var(--bg);
}
@media (max-width: 620px) {
  .progress-head { grid-template-columns: minmax(0, 1fr) auto auto; }
  .profile-card { box-shadow: 0 8px 20px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.025); }
}
.progress-box > .progress-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; justify-content: initial; gap: 10px; }

/* compact performance layer */
:root {
  --bg: #070b12;
  --bg-soft: #0d1320;
  --panel: #101827;
  --panel-2: #131d30;
  --line: #22304a;
  --line-strong: #30425f;
  --text: #f4f6fb;
  --muted: #99a5ba;
  --primary: #8d63ff;
  --primary-strong: #7447ef;
  --primary-soft: rgba(141, 99, 255, .12);
  --shadow: 0 12px 24px rgba(0,0,0,.16);
}
.app-frame { width: min(100%, 780px); border-inline-color: rgba(255,255,255,.045); }
.app-header { background: linear-gradient(180deg, rgba(10,15,24,.96), rgba(11,17,28,.93)); box-shadow: 0 10px 28px rgba(0,0,0,.18); }
.page-heading h1 { letter-spacing: -.03em; }
.page-heading p { max-width: 34ch; }
.tool-box, .panel-box, .selection-box, .progress-box, .stats-grid article {
  border-color: color-mix(in srgb, var(--line) 86%, var(--primary) 14%);
  background: linear-gradient(180deg, rgba(17,24,39,.98), rgba(14,20,33,.98));
}
.stats-grid { gap: 9px; }
.stats-grid article { min-height: 78px; }
.progress-box { position: sticky; top: 8px; z-index: 6; margin-bottom: 10px; padding: 9px 11px; border-radius: 12px; }
.progress-head { gap: 8px; }
.progress-head strong { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.progress-stop { min-height: 32px; }
.progress-track { margin-top: 8px; }
.cards-list { gap: 10px; }
.profile-card { padding: 10px; border-radius: 16px; }
.card-grid {
  --card-avatar-size: 80px;
  grid-template-columns: 28px var(--card-avatar-size) minmax(0, 1fr) 38px;
  grid-template-areas:
    "number avatar main side"
    ". avatar details details"
    ". avatar footer footer"
    ". avatar error error";
  column-gap: 10px;
  row-gap: 6px;
}
.card-number { width: 28px; height: 28px; font-size: .72rem; }
.avatar-wrap { width: var(--card-avatar-size); height: var(--card-avatar-size); border-radius: 14px; }
.avatar, .avatar-fallback { border-radius: 12px; }
.card-main { min-height: auto; gap: 4px; padding-top: 1px; }
.card-title-row { min-height: 28px; }
.card-title-row h3 { margin: 0; font-size: 1.08rem; line-height: 1.1; }
.username-row { min-height: 22px; gap: 5px; }
.card-side { grid-area: side; display: flex; flex-direction: column; align-items: stretch; gap: 5px; min-height: var(--card-avatar-size); }
.card-side .square-action, .card-side .side-gap { width: 38px; height: 30px; }
.card-side .square-action { min-height: 30px; }
.side-gap { display: block; }
.side-status { justify-content: center; width: 38px; min-height: 30px; padding: 0 4px; font-size: .51rem; line-height: 1.05; text-align: center; }
.detail-grid { gap: 6px; }
.detail-box { min-height: 44px; padding: 5px 7px; border-radius: 10px; }
.detail-box label { font-size: .5rem; }
.detail-value, .uid-app-link { font-size: .69rem; }
.card-footer { margin-top: 2px; gap: 5px; min-height: 21px; }
.card-footer:empty { display: none; }
.status-chip, .metric-chip, .instagram-chip { min-height: 21px; padding: 0 7px; border-radius: 999px; font-size: .54rem; }
.card-error { margin-top: 1px; font-size: .64rem; }
.card-menu { right: 10px; top: 41px; }
.bottom-nav { background: linear-gradient(180deg, rgba(9,13,22,.98), rgba(10,14,23,.98)); }
.nav-button { border-radius: 14px; }
.nav-button.active { background: linear-gradient(180deg, rgba(141,99,255,.15), rgba(141,99,255,.07)); }
@media (max-width: 620px) {
  .page-width { width: min(var(--page), calc(100% - 20px)); }
  .progress-box { top: 6px; }
  .profile-card { padding: 9px; }
  .card-grid { --card-avatar-size: 74px; grid-template-columns: 27px var(--card-avatar-size) minmax(0, 1fr) 36px; column-gap: 8px; row-gap: 5px; }
  .avatar-wrap { width: var(--card-avatar-size); height: var(--card-avatar-size); }
  .card-title-row h3 { font-size: 1.03rem; }
  .card-side .square-action, .card-side .side-gap, .side-status { width: 36px; }
  .detail-box { min-height: 42px; }
}
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid { --card-avatar-size: 72px; grid-template-columns: 26px var(--card-avatar-size) minmax(0, 1fr) 35px; }
  .card-number { width: 26px; height: 26px; }
  .username-link { font-size: .74rem; }
}

/* XeroxUID Final Stable Edition 2.1.0 */
.virtual-spacer { width: 100%; min-height: 0; pointer-events: none; overflow-anchor: none; contain: strict; }
.side-gap { display: none !important; }
.button-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.button-grid .box-button { width: 100%; min-width: 0; }
.audit-list { display: grid; gap: 7px; max-height: 420px; overflow: auto; overscroll-behavior: contain; }
.audit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-soft); }
.audit-row strong { min-width: 0; overflow-wrap: anywhere; font-size: .7rem; }
.audit-row span { color: var(--muted); font-size: .62rem; }
.audit-row small { grid-column: 1 / -1; color: var(--muted); font-size: .58rem; overflow-wrap: anywhere; }
.selection-box > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.selection-box button { min-height: 31px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-soft); font-size: .58rem; }
.list-actions { flex-wrap: wrap; justify-content: flex-end; }
.diagnostic-result { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.card-side { align-self: start; min-height: 0; }
.card-side .side-status { order: 3; }
.card-side [data-action="menu"] { order: 4; }
.card-side [data-action="star"] { order: 2; }
.card-side [data-app-link="instagram-detected"] { order: 1; }
.profile-card { overflow: hidden; }
.profile-card.menu-open { z-index: 12; overflow: visible; }
@media (max-width: 620px) {
  .button-grid { grid-template-columns: 1fr; }
  .selection-box { align-items: flex-start; }
  .selection-box > div { width: 100%; justify-content: flex-start; }
  .list-actions { width: 100%; justify-content: flex-start; }
  .list-actions .box-button { flex: 1 1 130px; }
}
@media (max-width: 360px) {
  .card-grid { --card-avatar-size: 64px; grid-template-columns: 24px var(--card-avatar-size) minmax(0, 1fr) 33px; column-gap: 6px; }
  .card-side .square-action, .side-status { width: 33px; }
  .detail-box { padding-inline: 6px; }
}
.backup-import-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 10px; }
.backup-import-row input { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 520px) { .backup-import-row { grid-template-columns: 1fr; } }


/* 2.1.0 Android stability and low-lag overrides */
.app-shell { height: 100dvh; height: var(--app-height); }
.app-content { scrollbar-gutter: stable; }
.cards-list { overflow-anchor: none; }
.profile-card { isolation: isolate; }
.profile-card.menu-open { isolation: auto; }
.avatar { background: var(--panel-2); }
@media (max-width: 620px) {
  .public-shell, .app-shell { background-image: none; }
  .profile-card, .profile-card.visited, .profile-card.selected {
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  }
  .avatar-wrap { box-shadow: none; }
  .tool-box, .panel-box, .selection-box, .progress-box, .stats-grid article {
    box-shadow: none;
  }
}

/* XeroxUID 2.2.0 — premium compact fixed-row mobile layer */
:root {
  --bg: #070a11;
  --bg-soft: #0c1220;
  --panel: #101827;
  --panel-2: #151f31;
  --line: #243149;
  --line-strong: #364762;
  --text: #f5f7fb;
  --muted: #9ca8bc;
  --primary: #936cff;
  --primary-strong: #7d52f4;
  --primary-soft: rgba(147, 108, 255, .13);
  --success: #42d7aa;
  --warning: #f5ba4f;
  --danger: #ff7180;
  --card-fixed-height: 116px;
  --card-list-gap: 8px;
  --virtual-row-height: 124px;
  --shadow: 0 10px 24px rgba(0, 0, 0, .18);
}
.font-sm {
  --card-fixed-height: 112px;
  --virtual-row-height: 120px;
}
.font-lg {
  --card-fixed-height: 124px;
  --virtual-row-height: 132px;
}
html:not(.dark) {
  --bg: #edf1f7;
  --bg-soft: #f7f9fc;
  --panel: #ffffff;
  --panel-2: #f0f3f8;
  --line: #d5dce8;
  --line-strong: #b9c5d7;
  --text: #141a25;
  --muted: #657187;
  --shadow: 0 8px 20px rgba(30, 43, 65, .1);
}
body {
  background: var(--bg);
}
.app-frame {
  border-inline-color: color-mix(in srgb, var(--line) 78%, transparent);
  background: var(--bg);
}
.app-header {
  min-height: 66px;
  padding: 8px 13px;
  background: color-mix(in srgb, var(--bg) 88%, var(--panel) 12%);
  border-bottom-color: color-mix(in srgb, var(--line) 82%, var(--primary) 18%);
  box-shadow: 0 7px 22px rgba(0, 0, 0, .16);
}
.app-header .brand-mark {
  box-shadow: 0 7px 16px rgba(125, 82, 244, .23);
}
.app-content {
  padding: 12px 12px 22px;
  scroll-behavior: auto;
}
.tool-box, .panel-box, .selection-box, .progress-box, .stats-grid article {
  background: color-mix(in srgb, var(--panel) 96%, var(--primary) 4%);
  border-color: color-mix(in srgb, var(--line) 88%, var(--primary) 12%);
  box-shadow: none;
}
.cards-list {
  gap: var(--card-list-gap);
  contain: layout style;
}
.profile-card,
.profile-card.visited,
.profile-card.selected {
  height: var(--card-fixed-height);
  min-height: var(--card-fixed-height);
  max-height: var(--card-fixed-height);
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--line) 84%, var(--primary) 16%);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 34%),
    color-mix(in srgb, var(--panel) 97%, var(--primary) 3%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
  overflow: hidden;
  transform: translateZ(0);
}
.profile-card::before {
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 2px;
  border-radius: 0 3px 3px 0;
  opacity: .95;
}
.profile-card.selected {
  border-color: color-mix(in srgb, var(--primary) 68%, var(--line));
  background: color-mix(in srgb, var(--panel) 92%, var(--primary) 8%);
}
.profile-card.menu-open {
  max-height: none;
  overflow: visible;
}
.card-grid {
  --card-avatar-size: 72px;
  height: 100%;
  display: grid;
  grid-template-columns: 24px var(--card-avatar-size) minmax(0, 1fr) auto;
  grid-template-rows: 33px 32px 18px;
  grid-template-areas:
    "number avatar main side"
    ". avatar details details"
    ". avatar footer footer";
  column-gap: 7px;
  row-gap: 3px;
  align-items: center;
}
.card-number {
  width: 24px;
  height: 24px;
  align-self: start;
  border-radius: 7px;
  font-size: .66rem;
  background: color-mix(in srgb, var(--bg-soft) 94%, var(--primary) 6%);
}
.avatar-wrap {
  width: var(--card-avatar-size);
  height: var(--card-avatar-size);
  align-self: start;
  padding: 2px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--primary), #3fbfd1 58%, var(--success));
  box-shadow: none;
}
.avatar, .avatar-fallback {
  border-radius: 10px;
  background: var(--panel-2);
}
.avatar-fallback {
  font-size: 1.45rem;
}
.card-main {
  height: 33px;
  min-height: 0;
  display: grid;
  grid-template-rows: 17px 15px;
  gap: 1px;
  align-content: center;
  overflow: hidden;
}
.card-title-row {
  min-height: 0;
  height: 17px;
}
.card-title-row h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 17px;
  letter-spacing: -.018em;
}
.username-row {
  min-height: 0;
  height: 15px;
  gap: 4px;
  overflow: hidden;
}
.username-link {
  font-size: .73rem;
  line-height: 14px;
}
.username-row .mini-copy {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex-basis: 18px;
  border: 0;
  background: transparent;
}
.card-side {
  grid-area: side;
  align-self: start;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}
.card-side .square-action,
.card-side .side-gap {
  width: 29px;
  height: 29px;
  min-height: 29px;
  border-radius: 8px;
}
.card-side .square-action svg {
  width: 15px;
  height: 15px;
}
.detail-grid {
  height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, .86fr);
  gap: 5px;
  margin: 0;
  overflow: hidden;
}
.detail-box {
  position: relative;
  min-height: 32px;
  height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21px;
  grid-template-rows: 10px 19px;
  column-gap: 3px;
  padding: 2px 4px 1px 6px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-soft) 96%, var(--primary) 4%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
  overflow: hidden;
}
.detail-box label {
  font-size: .46rem;
  line-height: 9px;
  letter-spacing: .075em;
}
.detail-value, .uid-app-link {
  align-self: center;
  font-size: .69rem;
  line-height: 18px;
}
.uid-app-link {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  letter-spacing: -.055em;
  font-size: clamp(.60rem, 2.72vw, .70rem);
  font-variant-numeric: tabular-nums;
}
.detail-box > .mini-copy {
  width: 21px;
  height: 21px;
  min-height: 21px;
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  border-radius: 6px;
}
.detail-box > .mini-copy svg {
  width: 13px;
  height: 13px;
}
/* A visited UID receives a subtle black shadow line at the top of its UID box. */
.profile-card.visited .uid-detail {
  border-top-color: rgba(0, 0, 0, .72);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, .48), inset 0 4px 7px rgba(0, 0, 0, .18);
}
.profile-card.visited .uid-app-link {
  color: color-mix(in srgb, var(--text) 82%, var(--muted) 18%);
}
.card-footer {
  height: 18px;
  min-height: 18px;
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow: hidden;
}
.status-chip, .metric-chip, .instagram-chip {
  min-height: 17px;
  height: 17px;
  flex: 0 0 auto;
  padding: 0 5px;
  border-radius: 5px;
  font-size: .48rem;
  line-height: 15px;
  white-space: nowrap;
}
.side-status {
  width: auto;
  min-width: 42px;
  order: 0 !important;
  justify-content: center;
}
.card-error {
  position: absolute;
  left: 103px;
  right: 8px;
  bottom: 5px;
  z-index: 2;
  height: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0 5px;
  border: 0;
  border-left: 2px solid rgba(255, 113, 128, .55);
  border-radius: 3px;
  background: rgba(255, 113, 128, .055);
  font-size: .55rem;
  line-height: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-card.has-error .card-footer {
  visibility: hidden;
}
.card-menu {
  top: 36px;
  right: 8px;
  width: 164px;
  box-shadow: 0 14px 30px rgba(0,0,0,.34);
}
.virtual-spacer {
  contain: size layout style;
}
.bottom-nav {
  min-height: 66px;
  padding-top: 6px;
  background: color-mix(in srgb, var(--bg) 90%, var(--panel) 10%);
  border-top-color: color-mix(in srgb, var(--line) 84%, var(--primary) 16%);
  box-shadow: 0 -8px 22px rgba(0,0,0,.16);
}
.nav-button {
  min-height: 50px;
  border-radius: 12px;
}
.nav-button.active {
  border-color: color-mix(in srgb, var(--primary) 46%, var(--line));
  background: linear-gradient(180deg, rgba(147,108,255,.14), rgba(147,108,255,.055));
}
@media (max-width: 420px) {
  :root {
    --card-fixed-height: 114px;
    --virtual-row-height: 122px;
  }
  .font-lg {
    --card-fixed-height: 122px;
    --virtual-row-height: 130px;
  }
  .app-content { padding-inline: 9px; }
  .card-grid {
    --card-avatar-size: 70px;
    grid-template-columns: 23px var(--card-avatar-size) minmax(0, 1fr) auto;
    column-gap: 6px;
  }
  .card-side .square-action, .card-side .side-gap {
    width: 27px;
    height: 27px;
    min-height: 27px;
  }
  .detail-grid { grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); }
}
@media (max-width: 360px) {
  :root {
    --card-fixed-height: 112px;
    --virtual-row-height: 120px;
  }
  .card-grid {
    --card-avatar-size: 68px;
    grid-template-columns: 22px var(--card-avatar-size) minmax(0, 1fr) auto;
    column-gap: 5px;
  }
  .card-side { gap: 2px; }
  .card-side .square-action, .card-side .side-gap {
    width: 25px;
    height: 25px;
    min-height: 25px;
  }
  .card-side .square-action svg { width: 13px; height: 13px; }
  .detail-box { padding-left: 4px; }
}
.font-lg .card-grid {
  grid-template-rows: 36px 34px 20px;
}
.font-lg .card-main {
  height: 36px;
  grid-template-rows: 19px 16px;
}
.font-lg .card-title-row { height: 19px; }
.font-lg .card-title-row h3 { line-height: 19px; }
.font-lg .username-row { height: 16px; }
.font-lg .detail-grid,
.font-lg .detail-box { height: 34px; min-height: 34px; }
.font-lg .card-footer { height: 20px; min-height: 20px; }

/* Final density normalization: old compact selectors must never break the
   four-column fixed-row contract used by virtualization. */
.compact-view {
  --card-list-gap: 6px;
}
.compact-view .profile-card,
.compact-view .profile-card.visited,
.compact-view .profile-card.selected {
  height: var(--card-fixed-height);
  min-height: var(--card-fixed-height);
  max-height: var(--card-fixed-height);
  padding: 7px 8px;
}
.compact-view .card-grid {
  --card-avatar-size: 72px;
  height: 100%;
  grid-template-columns: 24px var(--card-avatar-size) minmax(0, 1fr) auto;
  grid-template-rows: 33px 32px 18px;
  grid-template-areas:
    "number avatar main side"
    ". avatar details details"
    ". avatar footer footer";
  column-gap: 7px;
  row-gap: 3px;
}
.compact-view .avatar-wrap {
  width: var(--card-avatar-size);
  height: var(--card-avatar-size);
}
.compact-view .detail-box {
  min-height: 32px;
  height: 32px;
}
.compact-view .card-footer {
  height: 18px;
  min-height: 18px;
  margin: 0;
}
.uid-app-link {
  font-size: clamp(.70rem, 2.9vw, .78rem);
  letter-spacing: -.065em;
}
@media (max-width: 420px) {
  .compact-view .card-grid {
    --card-avatar-size: 70px;
    grid-template-columns: 23px var(--card-avatar-size) minmax(0, 1fr) auto;
    column-gap: 6px;
  }
}
@media (max-width: 360px) {
  .compact-view .card-grid {
    --card-avatar-size: 68px;
    grid-template-columns: 22px var(--card-avatar-size) minmax(0, 1fr) auto;
    column-gap: 5px;
  }
  .uid-app-link {
    font-size: clamp(.66rem, 3.15vw, .73rem);
  }
}

/* XeroxUID 2.2.1 — half-footprint card override.
   Text and 72px profile image remain unchanged; unused vertical space is removed. */
:root,
.font-sm,
.font-lg {
  --card-fixed-height: 88px;
  --card-list-gap: 8px;
  --virtual-row-height: 96px;
}
.profile-card,
.profile-card.visited,
.profile-card.selected,
.compact-view .profile-card {
  height: var(--card-fixed-height);
  min-height: var(--card-fixed-height);
  max-height: var(--card-fixed-height);
  padding: 4px 6px;
  border-radius: 11px;
}
.card-grid,
.compact-view .card-grid {
  --card-avatar-size: 72px;
  height: 80px;
  grid-template-columns: 22px var(--card-avatar-size) minmax(0, 1fr) auto;
  grid-template-rows: 31px 30px 15px;
  grid-template-areas:
    "number avatar main side"
    ". avatar details details"
    ". avatar footer footer";
  column-gap: 5px;
  row-gap: 2px;
}
.card-number {
  width: 22px;
  height: 22px;
  font-size: .66rem;
}
.avatar-wrap,
.compact-view .avatar-wrap {
  width: 72px;
  height: 72px;
  border-radius: 11px;
}
.avatar,
.avatar-fallback { border-radius: 9px; }
.card-main {
  height: 31px;
  grid-template-rows: 16px 14px;
  gap: 1px;
}
.card-title-row { height: 16px; }
.card-title-row h3 {
  font-size: 1.02rem;
  line-height: 16px;
}
.username-row { height: 14px; }
.username-link {
  font-size: .73rem;
  line-height: 13px;
}
.card-side { gap: 2px; }
.card-side .square-action,
.card-side .side-gap {
  width: 25px;
  height: 25px;
  min-height: 25px;
  border-radius: 7px;
}
.card-side .square-action svg {
  width: 14px;
  height: 14px;
}
.detail-grid {
  height: 30px;
  gap: 4px;
}
.detail-box,
.compact-view .detail-box {
  min-height: 30px;
  height: 30px;
  grid-template-rows: 9px 18px;
  padding-top: 1px;
  padding-bottom: 0;
}
.detail-box label { line-height: 8px; }
.detail-value,
.uid-app-link {
  font-size: .69rem;
  line-height: 17px;
}
.uid-app-link {
  font-size: clamp(.70rem, 2.9vw, .78rem);
  letter-spacing: -.065em;
}
.card-footer,
.compact-view .card-footer {
  height: 15px;
  min-height: 15px;
  gap: 3px;
}
.status-chip,
.metric-chip,
.instagram-chip {
  height: 15px;
  min-height: 15px;
  padding-inline: 4px;
  line-height: 13px;
}
.card-error {
  left: 105px;
  bottom: 2px;
  height: 13px;
  min-height: 13px;
  line-height: 13px;
}
.profile-card::before {
  top: 5px;
  bottom: 5px;
}
@media (max-width: 420px), (max-width: 360px) {
  .card-grid,
  .compact-view .card-grid {
    --card-avatar-size: 72px;
    grid-template-columns: 22px 72px minmax(0, 1fr) auto;
    column-gap: 5px;
  }
  .avatar-wrap,
  .compact-view .avatar-wrap {
    width: 72px;
    height: 72px;
  }
}

/* XeroxUID 2.2.2 — overlap-safe half-footprint card layout.
   The 72px avatar and existing typography are preserved. The serial badge is
   overlaid on the avatar so the remaining content can fit without clipping. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root,
html.font-sm,
html.font-md,
html.font-lg {
  --card-fixed-height: 92px;
  --card-list-gap: 6px;
  --virtual-row-height: 98px;
}

.profile-card,
.profile-card.visited,
.profile-card.selected,
body.compact-view .profile-card,
body.compact-view .profile-card.visited,
body.compact-view .profile-card.selected {
  height: var(--card-fixed-height);
  min-height: var(--card-fixed-height);
  max-height: var(--card-fixed-height);
  padding: 3px 5px;
  contain: layout style paint;
}

.profile-card.menu-open,
body.compact-view .profile-card.menu-open {
  contain: layout style;
  max-height: none;
}

.card-grid,
body.compact-view .card-grid,
html.font-sm .card-grid,
html.font-md .card-grid,
html.font-lg .card-grid {
  --card-avatar-size: 72px;
  position: relative;
  height: 84px;
  min-height: 84px;
  grid-template-columns: var(--card-avatar-size) minmax(0, 1fr) auto;
  grid-template-rows: 34px 32px 14px;
  grid-template-areas:
    "avatar main side"
    "avatar details details"
    "avatar footer footer";
  column-gap: 6px;
  row-gap: 2px;
  align-items: center;
}

.card-number,
html.font-lg .card-number {
  position: absolute;
  z-index: 3;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-color: color-mix(in srgb, var(--line-strong) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .34);
  font-size: .66rem;
  line-height: 1;
}

.avatar-wrap,
body.compact-view .avatar-wrap,
html.font-sm .avatar-wrap,
html.font-md .avatar-wrap,
html.font-lg .avatar-wrap {
  grid-area: avatar;
  width: 72px;
  height: 72px;
  align-self: center;
}

.card-main,
html.font-sm .card-main,
html.font-md .card-main,
html.font-lg .card-main {
  grid-area: main;
  height: 34px;
  min-height: 34px;
  grid-template-rows: 19px 14px;
  gap: 1px;
  align-content: center;
  padding: 0;
}

.card-title-row,
html.font-sm .card-title-row,
html.font-md .card-title-row,
html.font-lg .card-title-row {
  height: 19px;
  min-height: 19px;
  overflow: hidden;
}

.card-title-row h3,
html.font-sm .card-title-row h3,
html.font-md .card-title-row h3,
html.font-lg .card-title-row h3 {
  height: 19px;
  margin: 0;
  font-size: 1.02rem;
  line-height: 19px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.username-row,
html.font-sm .username-row,
html.font-md .username-row,
html.font-lg .username-row {
  height: 14px;
  min-height: 14px;
  line-height: 14px;
  overflow: hidden;
}

.username-link,
html.font-lg .username-link {
  font-size: .73rem;
  line-height: 13px;
}

.card-side,
html.font-sm .card-side,
html.font-md .card-side,
html.font-lg .card-side {
  grid-area: side;
  min-width: 0;
  min-height: 28px;
  max-height: 28px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  overflow: hidden;
}

.card-side .square-action,
.card-side .side-gap,
html.font-lg .card-side .square-action,
html.font-lg .card-side .side-gap {
  width: 27px;
  height: 27px;
  min-width: 27px;
  min-height: 27px;
  border-radius: 7px;
}

.card-side .square-action svg,
html.font-lg .card-side .square-action svg {
  width: 14px;
  height: 14px;
}

.detail-grid,
html.font-sm .detail-grid,
html.font-md .detail-grid,
html.font-lg .detail-grid {
  grid-area: details;
  height: 32px;
  min-height: 32px;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, .86fr);
  gap: 4px;
  margin: 0;
  overflow: hidden;
}

.detail-box,
body.compact-view .detail-box,
html.font-sm .detail-box,
html.font-md .detail-box,
html.font-lg .detail-box {
  height: 32px;
  min-height: 32px;
  grid-template-columns: minmax(0, 1fr) 21px;
  grid-template-rows: 10px 19px;
  column-gap: 3px;
  padding: 2px 4px 1px 6px;
  overflow: hidden;
}

.detail-box label,
html.font-lg .detail-box label {
  font-size: .46rem;
  line-height: 9px;
}

.detail-value,
.uid-app-link,
html.font-lg .detail-value,
html.font-lg .uid-app-link {
  min-width: 0;
  font-size: .69rem;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uid-app-link,
html.font-lg .uid-app-link {
  font-size: clamp(.70rem, 2.9vw, .78rem);
  letter-spacing: -.065em;
  text-overflow: clip;
}

.card-footer,
body.compact-view .card-footer,
html.font-sm .card-footer,
html.font-md .card-footer,
html.font-lg .card-footer {
  grid-area: footer;
  height: 14px;
  min-height: 14px;
  margin: 0;
  gap: 3px;
  overflow: hidden;
}

.status-chip,
.metric-chip,
.instagram-chip,
html.font-lg .status-chip,
html.font-lg .metric-chip,
html.font-lg .instagram-chip {
  height: 14px;
  min-height: 14px;
  padding-inline: 4px;
  font-size: .48rem;
  line-height: 12px;
}

.card-error,
html.font-lg .card-error {
  left: 83px;
  right: 5px;
  bottom: 3px;
  height: 14px;
  min-height: 14px;
  line-height: 14px;
}

/* Four controls exist: summary, percentage, Stop and Resume. Explicitly use
   four columns so Android never creates an implicit second row. */
.progress-box > .progress-head,
.progress-head {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

@media (max-width: 620px) {
  .progress-box {
    top: 0;
    margin-bottom: 7px;
    padding: 7px 8px;
    border-radius: 10px;
  }
  .progress-box > .progress-head,
  .progress-head {
    grid-template-columns: minmax(0, 1fr) 36px auto auto;
    gap: 5px;
  }
  .progress-stop {
    min-height: 28px;
    padding-inline: 8px;
  }
  .progress-track {
    height: 4px;
    margin-top: 6px;
  }
}

@media (max-width: 420px), (max-width: 360px) {
  :root,
  html.font-sm,
  html.font-md,
  html.font-lg {
    --card-fixed-height: 92px;
    --virtual-row-height: 98px;
  }
  .card-grid,
  body.compact-view .card-grid,
  html.font-sm .card-grid,
  html.font-md .card-grid,
  html.font-lg .card-grid {
    --card-avatar-size: 72px;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    column-gap: 5px;
  }
  .avatar-wrap,
  body.compact-view .avatar-wrap,
  html.font-sm .avatar-wrap,
  html.font-md .avatar-wrap,
  html.font-lg .avatar-wrap {
    width: 72px;
    height: 72px;
  }
  .card-side .square-action,
  html.font-lg .card-side .square-action {
    width: 26px;
    min-width: 26px;
    height: 26px;
    min-height: 26px;
  }
}
#progressText {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Border-box correction: 32px includes the border, so keep the internal grid
   within the 30px client box instead of letting labels/values overflow. */
.detail-box,
body.compact-view .detail-box,
html.font-sm .detail-box,
html.font-md .detail-box,
html.font-lg .detail-box {
  grid-template-rows: 9px 18px;
  padding-top: 1px;
  padding-bottom: 0;
}
.detail-box label,
html.font-lg .detail-box label {
  line-height: 8px;
}
/* Explicit grid placement prevents the full-width label from colliding with
   the copy button and being pushed into an implicit third row. */
.detail-box label,
html.font-lg .detail-box label {
  grid-column: 1;
  grid-row: 1;
}
.detail-value,
.uid-app-link,
html.font-lg .detail-value,
html.font-lg .uid-app-link {
  grid-column: 1;
  grid-row: 2;
}
.detail-box > .mini-copy,
html.font-lg .detail-box > .mini-copy {
  grid-column: 2;
  grid-row: 1 / 3;
}
