:root {
  color-scheme: dark;
  --bg: #090b14;
  --surface: rgba(19, 22, 37, 0.82);
  --surface-strong: #171a2b;
  --surface-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f7f7fb;
  --muted: #9399ad;
  --primary: #7c5cff;
  --primary-light: #a995ff;
  --cyan: #43d7ff;
  --green: #3de39c;
  --red: #ff667f;
  --amber: #ffbf5e;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(124, 92, 255, 0.2), transparent 36%),
    radial-gradient(circle at 100% 18%, rgba(67, 215, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #0b0d18 0%, #090b14 55%, #080a12 100%);
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.is-hidden { display: none !important; }

.ambient {
  position: fixed;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.2;
  pointer-events: none;
}
.ambient-one { top: 18%; left: -150px; background: var(--primary); }
.ambient-two { top: 58%; right: -170px; background: var(--cyan); }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px calc(30px + var(--safe-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  margin-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(145deg, #886dff, #5d3cf2);
  box-shadow: 0 10px 30px rgba(92, 60, 242, 0.34), inset 0 1px rgba(255, 255, 255, 0.25);
}
.brand-mark { position: relative; overflow: hidden; }
.brand-mark img { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; transition: opacity .2s ease; }
.brand-mark.has-image img { opacity: 1; }
.brand-mark.has-image span { opacity: 0; }
.brand-mark svg { width: 27px; fill: currentColor; }
.brand-title { font-size: 17px; font-weight: 780; letter-spacing: -0.02em; }
.brand-subtitle { margin-top: 2px; color: var(--muted); font-size: 12px; }

.icon-button {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}
.icon-button:active { transform: scale(0.93); }
.icon-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-button.small { width: 37px; height: 37px; border-radius: 12px; font-size: 27px; font-weight: 300; }
.icon-button.is-spinning svg { animation: spin 0.7s linear infinite; }

.profile-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 106px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: linear-gradient(135deg, rgba(34, 31, 67, 0.95), rgba(19, 22, 37, 0.88));
  box-shadow: var(--shadow);
}
.profile-card::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  right: -65px;
  bottom: -88px;
  border-radius: 50%;
  background: rgba(124, 92, 255, 0.2);
  filter: blur(5px);
}
.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  color: #100c29;
  background: linear-gradient(145deg, #c6baff, #8266ff);
  font-size: 23px;
  font-weight: 850;
  box-shadow: inset 0 1px rgba(255,255,255,.5), 0 12px 28px rgba(92,60,242,.3);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.profile-copy { flex: 1; min-width: 0; }
.eyebrow, .section-kicker {
  color: var(--primary-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.profile-copy h1 { margin: 4px 0 5px; overflow: hidden; font-size: 20px; letter-spacing: -0.03em; text-overflow: ellipsis; white-space: nowrap; }
.profile-meta { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.access-badge {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  max-width: 108px;
  padding: 7px 10px;
  border: 1px solid rgba(61, 227, 156, 0.24);
  border-radius: 999px;
  color: var(--green);
  background: rgba(61, 227, 156, 0.09);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}
.access-badge.free { color: var(--amber); border-color: rgba(255,191,94,.25); background: rgba(255,191,94,.08); }

.scope-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(124,92,255,.22);
  border-radius: 20px;
  background: rgba(124,92,255,.08);
}
.scope-caption { margin-top: 4px; color: var(--muted); font-size: 11px; }
.segmented { display: flex; padding: 3px; border-radius: 12px; background: rgba(0,0,0,.22); }
.segmented button { min-width: 57px; height: 32px; padding: 0 11px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 750; cursor: pointer; }
.segmented button.is-active { color: white; background: var(--primary); box-shadow: 0 6px 16px rgba(92,60,242,.25); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0;
}
.stat-card {
  display: flex;
  min-width: 0;
  min-height: 91px;
  padding: 12px 10px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  backdrop-filter: blur(18px);
}
.stat-icon { color: var(--muted); font-size: 14px; font-weight: 800; }
.stat-card strong { overflow: hidden; font-size: clamp(17px, 5vw, 22px); letter-spacing: -0.05em; text-overflow: ellipsis; }
.stat-card > span:last-child { color: var(--muted); font-size: 10px; }
.stat-primary { border-color: rgba(124,92,255,.24); background: linear-gradient(145deg, rgba(124,92,255,.19), rgba(19,22,37,.9)); }
.stat-primary .stat-icon, .stat-primary strong { color: var(--primary-light); }
.stat-danger strong { color: #ff899c; }

.bulk-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}
.bulk-caption { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.bulk-actions { display: flex; gap: 8px; }
.button {
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 14px;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
  transition: transform .16s ease, opacity .16s ease, filter .16s ease;
}
.button:active { transform: scale(.96); }
.button:disabled { opacity: .45; cursor: wait; }
.button-success { color: #081b13; background: linear-gradient(135deg, #58ecad, #2bcf8a); }
.button-primary { color: white; background: linear-gradient(135deg, #8c72ff, #6644f0); box-shadow: 0 11px 25px rgba(102,68,240,.24); }
.button-ghost { border: 1px solid var(--line-strong); background: rgba(255,255,255,.045); }
.button-danger { color: #ffdce2; background: rgba(255,102,127,.12); }
.button-wide { width: 100%; margin-top: 10px; min-height: 52px; font-size: 14px; }
.button-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #087647; }

.accounts-section { margin-top: 24px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 13px; }
.section-heading h2, .sheet-header h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -0.04em; }
.count-pill { min-width: 32px; padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: 12px; text-align: center; }

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.04);
}
.search-box:focus-within { border-color: rgba(124,92,255,.55); box-shadow: 0 0 0 3px rgba(124,92,255,.09); }
.search-box svg { width: 19px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #6f7488; }

.filter-row { display: flex; gap: 8px; margin: 12px 0 14px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; min-height: 34px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.filter-chip.is-active { color: white; border-color: rgba(124,92,255,.45); background: rgba(124,92,255,.2); }

.accounts-list { display: grid; gap: 12px; }
.account-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: linear-gradient(145deg, rgba(25,28,46,.96), rgba(15,17,29,.94));
  box-shadow: 0 13px 35px rgba(0,0,0,.16);
}
.account-card.running { border-color: rgba(61,227,156,.24); }
.account-accent { height: 3px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.account-card.running .account-accent { background: linear-gradient(90deg, #26c985, #68efb8); }
.account-card.problem .account-accent { background: linear-gradient(90deg, #ff536f, #ffac76); }
.account-main { padding: 15px 15px 13px; }
.account-head { display: flex; align-items: center; gap: 12px; }
.account-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 15px; color: var(--primary-light); background: rgba(124,92,255,.13); font-weight: 850; }
.account-card.running .account-avatar { color: var(--green); background: rgba(61,227,156,.11); }
.account-identity { flex: 1; min-width: 0; }
.account-name { overflow: hidden; font-size: 15px; font-weight: 780; text-overflow: ellipsis; white-space: nowrap; }
.account-subtitle { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.owner-line { margin-top: 6px; color: #c0b5ff; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; color: #a9aec1; background: rgba(255,255,255,.055); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #777d91; }
.status-pill.running { color: var(--green); background: rgba(61,227,156,.09); }
.status-pill.running::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-pill.problem { color: #ff91a3; background: rgba(255,102,127,.09); }
.status-pill.problem::before { background: var(--red); }

.account-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.tag { padding: 5px 8px; border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.045); font-size: 9px; font-weight: 650; }
.tag.good { color: var(--green); background: rgba(61,227,156,.08); }
.tag.warn { color: var(--amber); background: rgba(255,191,94,.08); }
.tag.bad { color: #ff91a3; background: rgba(255,102,127,.08); }

.account-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 13px; }
.metric { min-width: 0; padding: 10px; border-radius: 13px; background: rgba(255,255,255,.032); }
.metric strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; }
.metric span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.account-error { margin-top: 11px; padding: 10px 11px; border-left: 2px solid var(--red); border-radius: 8px 12px 12px 8px; color: #ffb5c0; background: rgba(255,102,127,.065); font-size: 10px; line-height: 1.45; }
.account-actions { display: grid; grid-template-columns: 1.2fr 1fr 44px; gap: 8px; padding: 11px 15px 15px; border-top: 1px solid rgba(255,255,255,.055); }
.account-actions .button { min-height: 40px; }
.check-button { width: 44px; min-width: 44px; padding: 0; border: 1px solid var(--line); background: rgba(255,255,255,.04); font-size: 16px; }

.empty-state { padding: 42px 20px; border: 1px dashed var(--line-strong); border-radius: 22px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 12px; border-radius: 17px; color: var(--primary-light); background: rgba(124,92,255,.12); font-size: 25px; }
.empty-state h3 { margin: 0; font-size: 16px; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.footer-note { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 22px 0 4px; color: #666c80; font-size: 10px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(61,227,156,.65); }

.screen-state { position: relative; z-index: 3; display: flex; min-height: 100vh; min-height: 100dvh; padding: 32px; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.screen-state h2 { margin: 20px 0 8px; font-size: 21px; }
.screen-state p { max-width: 310px; margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.loader-logo, .error-symbol { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 23px; color: white; background: linear-gradient(145deg, #8c72ff, #5a38e5); font-size: 28px; font-weight: 900; box-shadow: 0 18px 44px rgba(92,60,242,.32); }
.loader-ring { width: 32px; height: 32px; margin-top: 22px; border: 3px solid rgba(255,255,255,.09); border-top-color: var(--primary-light); border-radius: 50%; animation: spin .75s linear infinite; }
.error-symbol { color: #2a0810; background: linear-gradient(145deg, #ff8ba0, #ff536f); }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding-top: 60px; background: rgba(3,4,9,.68); backdrop-filter: blur(8px); }
.settings-sheet, .detail-sheet, .login-sheet { width: min(100%, 720px); max-height: calc(100dvh - 24px); padding: 10px 18px calc(20px + var(--safe-bottom)); overflow-y: auto; border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 28px 28px 0 0; background: #111421; box-shadow: 0 -25px 70px rgba(0,0,0,.45); animation: slide-up .24s ease-out; }
.detail-sheet { padding-left: 14px; padding-right: 14px; }
.detail-header { display: flex; align-items: center; gap: 12px; }
.detail-avatar { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto; border-radius: 16px; color: var(--primary-light); background: rgba(124,92,255,.14); font-weight: 850; }
.detail-title { flex: 1; min-width: 0; }
.detail-title h2 { margin: 3px 0 3px; overflow: hidden; font-size: 19px; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.detail-status-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; margin: 15px 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.detail-status-row .button { min-height: 37px; }
.detail-tabs { display: flex; gap: 6px; margin: 0 -2px 14px; padding: 3px; overflow-x: auto; border-radius: 14px; background: rgba(0,0,0,.2); scrollbar-width: none; }
.detail-tabs::-webkit-scrollbar { display: none; }
.detail-tabs button { flex: 0 0 auto; min-height: 35px; padding: 0 12px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 750; cursor: pointer; }
.detail-tabs button.is-active { color: white; background: rgba(124,92,255,.25); }
.tab-page { min-height: 340px; }
.textarea, .select { width: 100%; border: 1px solid var(--line); outline: 0; border-radius: 14px; color: var(--text); background: rgba(255,255,255,.035); }
.textarea { min-height: 132px; padding: 13px; resize: vertical; line-height: 1.5; }
.small-textarea { min-height: 92px; }
.select { height: 49px; padding: 0 12px; }
.select option { color: var(--text); background: var(--surface-strong); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.subsection-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 24px 0 11px; }
.subsection-head h3 { margin: 4px 0 0; font-size: 16px; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 12px 0; }
.inline-form input { min-width: 0; height: 45px; padding: 0 12px; border: 1px solid var(--line); outline: 0; border-radius: 13px; color: var(--text); background: rgba(255,255,255,.035); }
.compact-list { display: grid; gap: 7px; }
.compact-row { display: flex; align-items: center; gap: 10px; min-height: 49px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.compact-row-main { flex: 1; min-width: 0; }
.compact-row-title { overflow: hidden; font-size: 11px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.compact-row-subtitle { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mini-action { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.035); cursor: pointer; }
.mini-action.danger { color: #ff9aab; }
.mini-toggle { width: 42px; height: 25px; }
.mini-toggle::after { width: 17px; height: 17px; }
.compact-row input:checked + .mini-toggle::after { transform: translateX(17px); }
.row-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.action-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 10px 0 18px; }
.upload-zone { display: grid; place-items: center; gap: 5px; min-height: 92px; margin: 12px 0; padding: 16px; border: 1px dashed rgba(124,92,255,.5); border-radius: 16px; color: var(--primary-light); background: rgba(124,92,255,.07); text-align: center; cursor: pointer; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone span { font-size: 12px; font-weight: 760; }
.upload-zone small { color: var(--muted); font-size: 10px; }
.check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 12px 0; }
.check-grid label { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 10px; }
.check-grid input { accent-color: var(--primary); }
.feature-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 13px 0; }
.feature-card { position: relative; display: flex; align-items: center; gap: 10px; min-height: 76px; padding: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; color: var(--text); background: linear-gradient(145deg,rgba(255,255,255,.045),rgba(255,255,255,.015)); text-align: left; cursor: pointer; transition: transform .22s ease,border-color .22s ease,box-shadow .22s ease; }
.feature-card:active { transform: scale(.97); }
.feature-card.is-active { border-color: rgba(61,227,156,.38); box-shadow: 0 10px 30px rgba(61,227,156,.08); }
.feature-icon { display: grid; place-items: center; width: 37px; height: 37px; flex: 0 0 auto; border-radius: 13px; color: var(--primary-light); background: rgba(124,92,255,.15); font-size: 17px; font-weight: 850; }
.feature-card.is-active .feature-icon { color: var(--green); background: rgba(61,227,156,.13); }
.feature-card strong,.feature-card small { display: block; }
.feature-card strong { font-size: 11px; }
.feature-card small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.feature-card i { position: absolute; top: 10px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: #4a4e60; }
.feature-card.is-active i { background: var(--green); box-shadow: 0 0 0 5px rgba(61,227,156,.09),0 0 14px rgba(61,227,156,.6); animation: status-pulse 2s infinite; }
.analytics-hero { display: flex; align-items: center; gap: 16px; margin: 15px 0; padding: 15px; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(circle at 10% 0%,rgba(124,92,255,.13),transparent 45%),rgba(255,255,255,.025); }
.success-ring { --rate: 0deg; display: grid; place-items: center; align-content: center; width: 92px; height: 92px; flex: 0 0 auto; border-radius: 50%; background: radial-gradient(circle closest-side,#141725 73%,transparent 75%),conic-gradient(var(--green) var(--rate),rgba(255,255,255,.08) 0); animation: ring-in .7s ease both; }
.success-ring strong,.success-ring span { display: block; }
.success-ring strong { font-size: 18px; }
.success-ring span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.analytics-copy { flex: 1; min-width: 0; }
.analytics-copy strong,.analytics-copy span { display: block; }
.analytics-copy strong { font-size: 13px; }
.analytics-copy span { margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.progress-track { height: 6px; margin-top: 13px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.07); }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--primary),var(--green)); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.mini-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.mini-stats div { padding: 11px 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); text-align: center; }
.mini-stats strong,.mini-stats span { display: block; }
.mini-stats strong { font-size: 15px; }
.mini-stats span { margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.25; }
.history-chart { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); align-items: end; gap: 6px; height: 150px; padding: 13px 8px 7px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.02); }
.chart-column { display: grid; grid-template-rows: 16px 1fr 15px; align-items: end; height: 100%; text-align: center; }
.chart-column strong,.chart-column span { color: var(--muted); font-size: 8px; }
.chart-column div { position: relative; height: 100%; overflow: hidden; border-radius: 8px 8px 4px 4px; background: rgba(255,255,255,.035); }
.chart-column i { position: absolute; right: 0; bottom: 0; left: 0; min-height: 5px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg,var(--primary-light),var(--primary)); transform-origin: bottom; animation: bar-rise .65s cubic-bezier(.2,.8,.2,1) both; }
.detail-sheet { animation: sheet-enter .32s cubic-bezier(.2,.8,.2,1); }
.account-card { animation: card-enter .38s ease both; }
.account-card:nth-child(2n) { animation-delay: .035s; }
.count-pill.positive { color: var(--green); border-color: rgba(61,227,156,.22); background: rgba(61,227,156,.08); }
.sticky-save { position: sticky; z-index: 2; bottom: calc(-20px - var(--safe-bottom)); margin: 18px -14px calc(-20px - var(--safe-bottom)); padding: 10px 14px calc(15px + var(--safe-bottom)); border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(17,20,33,.2), #111421 24%); }
.sheet-note { margin: 8px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 14px; border-radius: 99px; background: #3d4153; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.field { display: block; margin: 13px 0; }
.field > span, .switch-field > div > span { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 720; }
.field small, .switch-field small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.field-control { display: flex; align-items: center; height: 49px; padding: 0 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.035); }
.field-control:focus-within { border-color: rgba(124,92,255,.6); }
.field-control input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 14px; font-weight: 700; }
.field-control span { color: var(--muted); font-size: 11px; }
.switch-field { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 19px 0 12px; cursor: pointer; }
.switch-field > div { flex: 1; }
.switch-field input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; flex: 0 0 auto; width: 48px; height: 28px; border-radius: 99px; background: #303445; transition: background .2s ease; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 2px 7px rgba(0,0,0,.35); transition: transform .2s ease; }
.switch-field input:checked + .switch { background: var(--primary); }
.switch-field input:checked + .switch::after { transform: translateX(20px); }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(18px + var(--safe-bottom)); width: max-content; max-width: calc(100% - 32px); padding: 11px 15px; border: 1px solid var(--line-strong); border-radius: 13px; color: var(--text); background: rgba(28,31,48,.96); box-shadow: var(--shadow); font-size: 11px; line-height: 1.4; opacity: 0; pointer-events: none; transform: translate(-50%, 18px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { color: #ffd3da; border-color: rgba(255,102,127,.27); background: rgba(58,24,34,.97); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes status-pulse { 50% { opacity: .55; transform: scale(.8); } }
@keyframes ring-in { from { opacity: 0; transform: scale(.82) rotate(-30deg); } }
@keyframes bar-rise { from { transform: scaleY(0); } }
@keyframes sheet-enter { from { opacity: 0; transform: translateY(35px); } }
@keyframes card-enter { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 430px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .summary-grid { gap: 7px; }
  .stat-card { min-height: 86px; padding: 11px 8px; border-radius: 17px; }
  .bulk-panel { align-items: stretch; flex-direction: column; }
  .bulk-actions { display: grid; grid-template-columns: 1.4fr 1fr; }
  .bulk-actions .button { width: 100%; }
  .profile-card { padding: 16px; }
  .access-badge { max-width: 88px; }
}

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


/* v8 — Linear-style operational console */
:root {
  --bg: #08090a;
  --surface: #111214;
  --surface-strong: #18191c;
  --surface-soft: #202125;
  --line: #25262a;
  --line-strong: #34353a;
  --text: #f2f3f5;
  --muted: #8a8f98;
  --primary: #5e6ad2;
  --primary-light: #8c94e8;
  --cyan: #8a8f98;
  --green: #4cb782;
  --red: #eb5757;
  --amber: #e2b203;
  --shadow: 0 12px 32px rgba(0,0,0,.24);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body { color: var(--text); background: var(--bg); }
.ambient { display: none; }
.app-shell { width: min(100%,760px); padding: max(12px,env(safe-area-inset-top)) 16px calc(28px + var(--safe-bottom)); }
.topbar { min-height: 48px; margin-bottom: 18px; }
.brand { gap: 10px; }
.brand-mark { width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-strong); box-shadow: none; }
.brand-title { font-size: 15px; font-weight: 600; letter-spacing: -.012em; }
.brand-subtitle { margin-top: 1px; font-size: 10px; }
.icon-button,.icon-button.small { border-color: var(--line); border-radius: 8px; background: var(--surface); box-shadow: none; transition: color 120ms ease,border-color 120ms ease,background 120ms ease,transform 120ms ease; }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-strong); }
.icon-button:focus-visible,.button:focus-visible,.detail-tabs button:focus-visible,.filter-chip:focus-visible,.feature-card:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.profile-card { min-height: 88px; padding: 15px; border-color: var(--line); border-radius: 12px; background: var(--surface); box-shadow: none; }
.profile-card::after { display: none; }
.avatar { width: 48px; height: 48px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-soft); box-shadow: none; font-size: 17px; font-weight: 600; }
.eyebrow,.section-kicker { color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .08em; }
.profile-copy h1 { margin: 3px 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.profile-meta { font-size: 11px; }
.access-badge,.access-badge.free { padding: 5px 8px; border-color: var(--line-strong); border-radius: 6px; color: var(--text); background: var(--surface-strong); font-size: 9px; font-weight: 500; }
.scope-panel,.bulk-panel,.accounts-section { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: none; }
.scope-panel { margin-top: 10px; padding: 12px 14px; }
.segmented { gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.segmented button { min-height: 32px; padding: 0 11px; border-radius: 6px; font-size: 10px; font-weight: 500; }
.segmented button.is-active { color: var(--text); background: var(--surface-soft); box-shadow: none; }
.summary-grid { gap: 8px; margin-top: 10px; }
.stat-card,.stat-card.stat-primary,.stat-card.stat-danger { min-height: 82px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: none; }
.stat-card:hover { border-color: var(--line-strong); }
.stat-card strong { font-size: 22px; font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat-card span:last-child { color: var(--muted); font-size: 9px; }
.stat-icon { width: 7px; height: 7px; overflow: hidden; border-radius: 50%; color: transparent; background: var(--muted); }
.stat-primary .stat-icon { background: var(--green); }
.stat-danger .stat-icon { background: var(--red); }
.bulk-panel { margin-top: 10px; padding: 13px 14px; }
.bulk-caption { margin-top: 4px; font-size: 11px; }
.button { min-height: 40px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 11px; font-weight: 500; box-shadow: none; transition: color 120ms ease,border-color 120ms ease,background 120ms ease,transform 120ms ease; }
.button:hover:not(:disabled) { border-color: #47484e; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { border-color: var(--primary); background: var(--primary); }
.button-primary:hover:not(:disabled) { border-color: var(--primary-light); background: #6874db; }
.button-success { border-color: rgba(76,183,130,.35); color: #8ed6b1; background: rgba(76,183,130,.1); }
.button-danger { border-color: rgba(235,87,87,.35); color: #f28f8f; background: rgba(235,87,87,.1); }
.button-ghost,.check-button { background: var(--surface-strong); }
.accounts-section { margin-top: 10px; padding: 15px; }
.section-heading h2 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.count-pill { border-color: var(--line); border-radius: 6px; background: var(--surface-strong); font-size: 9px; font-weight: 500; }
.search-box,.field-control,.select,.textarea,.inline-form { border-color: var(--line); border-radius: 8px; background: var(--bg); box-shadow: none; }
.search-box:focus-within,.field-control:focus-within,.textarea:focus,.select:focus { border-color: var(--primary); }
.filter-row { gap: 5px; }
.filter-chip { min-height: 32px; border: 1px solid var(--line); border-radius: 7px; background: transparent; font-size: 9px; font-weight: 500; }
.filter-chip.is-active { border-color: var(--line-strong); color: var(--text); background: var(--surface-soft); }
.accounts-list { gap: 6px; }
.account-card { border-color: var(--line); border-radius: 9px; background: var(--bg); box-shadow: none; animation: row-enter 180ms ease both; }
.account-card:hover { border-color: var(--line-strong); background: #0c0d0f; }
.account-accent { width: 2px; background: var(--line-strong); }
.account-card.running .account-accent { background: var(--green); }
.account-main { padding: 12px; }
.account-avatar { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 600; }
.account-card.running .account-avatar { color: var(--green); background: rgba(76,183,130,.07); }
.account-name { font-size: 12px; font-weight: 600; }
.account-subtitle,.owner-line { font-size: 9px; }
.status-pill { border-radius: 5px; font-size: 8px; font-weight: 500; }
.account-tags span { border-radius: 5px; background: var(--surface); }
.account-metrics { border-top-color: var(--line); }
.metric strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.account-actions { gap: 6px; padding: 9px 10px; border-top-color: var(--line); background: var(--surface); }
.modal-backdrop { background: rgba(0,0,0,.72); backdrop-filter: none; }
.detail-sheet,.login-sheet { border: 1px solid var(--line-strong); border-radius: 14px 14px 0 0; background: var(--surface); box-shadow: var(--shadow); animation: sheet-enter-v8 180ms ease-out; }
.detail-avatar { border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface-strong); font-weight: 600; }
.detail-title h2 { font-weight: 600; }
.detail-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; padding: 4px; overflow: visible; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.detail-tabs button { min-height: 34px; padding: 0 7px; border-radius: 6px; color: var(--muted); font-size: 9px; font-weight: 500; }
.detail-tabs button.is-active { color: var(--text); background: var(--surface-soft); box-shadow: none; }
.tab-page { padding-top: 16px; }
.switch-field,.compact-row,.analytics-hero,.mini-stats div,.history-chart,.feature-card { border-color: var(--line); background: var(--bg); box-shadow: none; }
.feature-grid { gap: 7px; }
.feature-card { min-height: 66px; border-radius: 9px; }
.feature-icon { width: 30px; height: 30px; border-radius: 7px; color: var(--muted); background: var(--surface-strong); font-size: 13px; }
.feature-card.is-active { border-color: rgba(76,183,130,.35); box-shadow: none; }
.feature-card.is-active .feature-icon { color: var(--green); background: rgba(76,183,130,.08); }
.feature-card.is-active i { box-shadow: none; animation: none; }
.analytics-hero { border-radius: 10px; }
.success-ring { width: 82px; height: 82px; background: radial-gradient(circle closest-side,var(--bg) 73%,transparent 75%),conic-gradient(var(--green) var(--rate),var(--surface-soft) 0); animation: none; }
.mini-stats div { border-radius: 8px; }
.history-chart { border-radius: 9px; }
.chart-column div { border-radius: 4px; background: var(--surface-strong); }
.chart-column i { border-radius: 4px; background: var(--primary); animation: bar-rise-v8 320ms ease-out both; }
.proxyStatus.positive { color: var(--green); }
.upload-zone { border-color: var(--line-strong); border-radius: 9px; color: var(--text); background: var(--bg); }
.sticky-save { border-top-color: var(--line); background: linear-gradient(180deg,rgba(17,18,20,0),var(--surface) 24%); }
.toast { border-color: var(--line-strong); border-radius: 8px; background: var(--surface-strong); box-shadow: var(--shadow); }
.loader-logo,.error-symbol { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-strong); box-shadow: none; font-weight: 600; }
.empty-state { border-color: var(--line); border-radius: 10px; background: var(--bg); }
@keyframes row-enter { from { opacity: 0; transform: translateY(5px); } }
@keyframes sheet-enter-v8 { from { opacity: 0; transform: translateY(16px); } }
@keyframes bar-rise-v8 { from { transform: scaleY(0); } }
@media (max-width: 430px) {
  .app-shell { padding-right: 10px; padding-left: 10px; }
  .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .profile-card { padding: 13px; }
  .access-badge { max-width: 84px; }
}

/* v9 ? RaveSender premium command center */
:root {
  --bg: #070812;
  --surface: rgba(17, 18, 34, .82);
  --surface-strong: #17182a;
  --surface-soft: rgba(255, 255, 255, .055);
  --line: rgba(255, 255, 255, .085);
  --line-strong: rgba(255, 255, 255, .15);
  --text: #f8f8ff;
  --muted: #9296ab;
  --primary: #7867f2;
  --primary-light: #a99cff;
  --cyan: #57d5ff;
  --green: #49d99a;
  --red: #ff6b81;
  --amber: #ffc35c;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --shadow: 0 24px 64px rgba(0, 0, 0, .34);
}

html { background: var(--bg); }
body {
  background:
    radial-gradient(circle at 7% -8%, rgba(120, 103, 242, .28), transparent 34%),
    radial-gradient(circle at 104% 18%, rgba(87, 213, 255, .14), transparent 28%),
    linear-gradient(180deg, #0a0b18 0%, var(--bg) 48%, #080914 100%);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: .28;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}
.ambient { display: block; opacity: .13; filter: blur(105px); }
.ambient-one { top: 9%; left: -125px; background: var(--primary); }
.ambient-two { top: 54%; right: -160px; background: var(--cyan); }
.app-shell { width: min(100%, 780px); padding: max(12px, env(safe-area-inset-top)) 14px calc(32px + var(--safe-bottom)); }

.topbar {
  position: sticky;
  z-index: 12;
  top: 0;
  min-height: 58px;
  margin: 0 -4px 14px;
  padding: 7px 4px;
  background: linear-gradient(180deg, rgba(7,8,18,.96) 0%, rgba(7,8,18,.76) 78%, transparent 100%);
  backdrop-filter: blur(18px) saturate(145%);
}
.brand { gap: 11px; }
.brand-mark {
  width: 39px;
  height: 39px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: linear-gradient(145deg, #9b8cff, #6655e8 58%, #5141c9);
  box-shadow: 0 10px 28px rgba(91,72,220,.32), inset 0 1px rgba(255,255,255,.3);
}
.brand-title { font-size: 16px; font-weight: 720; letter-spacing: -.025em; }
.brand-subtitle { color: #777c93; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.icon-button,
.icon-button.small {
  border-color: var(--line);
  border-radius: 12px;
  color: #d9dbea;
  background: rgba(255,255,255,.045);
  box-shadow: inset 0 1px rgba(255,255,255,.055);
  transition: transform 140ms var(--ease-out), border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.icon-button:active { transform: scale(.96); }

.profile-card,
.scope-panel,
.bulk-panel,
.accounts-section {
  border-color: var(--line);
  background: linear-gradient(145deg, rgba(24,25,44,.88), rgba(14,15,29,.9));
  box-shadow: inset 0 1px rgba(255,255,255,.045), 0 18px 44px rgba(0,0,0,.16);
  backdrop-filter: blur(20px) saturate(130%);
}
.profile-card {
  min-height: 98px;
  padding: 17px;
  border-radius: 18px;
  overflow: hidden;
}
.profile-card::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  top: -110px;
  right: -65px;
  border-radius: 50%;
  background: rgba(120,103,242,.18);
  filter: blur(26px);
  pointer-events: none;
}
.avatar {
  width: 54px;
  height: 54px;
  border-color: rgba(255,255,255,.15);
  border-radius: 16px;
  color: white;
  background: linear-gradient(145deg, rgba(169,156,255,.22), rgba(120,103,242,.08));
  box-shadow: inset 0 1px rgba(255,255,255,.11), 0 9px 24px rgba(0,0,0,.2);
}
.eyebrow,
.section-kicker { color: #797e98; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.profile-copy h1 { margin: 4px 0; font-size: clamp(19px, 5vw, 23px); font-weight: 720; letter-spacing: -.035em; }
.profile-meta { color: var(--muted); font-size: 11px; }
.access-badge,
.access-badge.free {
  position: relative;
  border-color: rgba(169,156,255,.23);
  border-radius: 999px;
  color: #d8d2ff;
  background: rgba(120,103,242,.12);
  box-shadow: inset 0 1px rgba(255,255,255,.06);
  font-weight: 700;
}

.scope-panel { margin-top: 11px; padding: 13px 15px; border-radius: 15px; }
.segmented { border-color: var(--line); border-radius: 11px; background: rgba(3,4,12,.52); }
.segmented button { min-height: 34px; border-radius: 8px; transition: transform 140ms var(--ease-out), color 160ms ease, background-color 160ms ease; }
.segmented button.is-active { background: rgba(255,255,255,.085); box-shadow: inset 0 1px rgba(255,255,255,.06), 0 4px 14px rgba(0,0,0,.16); }
.segmented button:active { transform: scale(.97); }

.summary-grid { gap: 9px; margin-top: 11px; }
.stat-card,
.stat-card.stat-primary,
.stat-card.stat-danger {
  position: relative;
  min-height: 92px;
  padding: 14px;
  overflow: hidden;
  border-color: var(--line);
  border-radius: 15px;
  background: linear-gradient(155deg, rgba(25,26,45,.92), rgba(13,14,27,.9));
  box-shadow: inset 0 1px rgba(255,255,255,.045), 0 12px 30px rgba(0,0,0,.12);
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -32px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(146,150,171,.08);
  filter: blur(16px);
}
.stat-card strong { font-size: 25px; font-weight: 720; letter-spacing: -.045em; }
.stat-card span:last-child { color: #858a9e; font-size: 10px; font-weight: 600; }
.stat-icon { width: 8px; height: 8px; box-shadow: 0 0 0 4px rgba(146,150,171,.08); }
.stat-primary .stat-icon { box-shadow: 0 0 0 4px rgba(73,217,154,.1), 0 0 16px rgba(73,217,154,.35); }
.stat-danger .stat-icon { box-shadow: 0 0 0 4px rgba(255,107,129,.1), 0 0 16px rgba(255,107,129,.28); }

.bulk-panel { margin-top: 11px; padding: 15px; border-radius: 16px; }
.bulk-caption { color: var(--muted); }
.bulk-actions { gap: 7px; }
.button {
  min-height: 42px;
  border-color: var(--line-strong);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 680;
  box-shadow: inset 0 1px rgba(255,255,255,.055);
  transition: transform 140ms var(--ease-out), border-color 160ms ease, background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}
.button:active:not(:disabled) { transform: scale(.97); }
.button-primary {
  border-color: rgba(169,156,255,.36);
  background: linear-gradient(145deg, #8372f5, #6757dc);
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 8px 20px rgba(91,72,220,.22);
}
.button-primary:hover:not(:disabled) { border-color: rgba(205,199,255,.48); background: linear-gradient(145deg, #8e7ef7, #7161e4); }
.button-success { border-color: rgba(73,217,154,.24); color: #8aebbd; background: rgba(73,217,154,.1); }
.button-danger { border-color: rgba(255,107,129,.25); color: #ff9aaa; background: rgba(255,107,129,.09); }
.button-ghost,
.check-button { color: #c7cad9; background: rgba(255,255,255,.045); }

.accounts-section { margin-top: 11px; padding: 16px; border-radius: 18px; }
.section-heading h2 { font-size: 19px; font-weight: 720; letter-spacing: -.03em; }
.count-pill { border-color: var(--line); border-radius: 999px; color: #c4c7d6; background: rgba(255,255,255,.055); font-weight: 700; }
.search-box,
.field-control,
.select,
.textarea,
.inline-form {
  border-color: var(--line);
  border-radius: 12px;
  background: rgba(3,4,12,.48);
  box-shadow: inset 0 1px rgba(255,255,255,.025);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.search-box:focus-within,
.field-control:focus-within,
.textarea:focus,
.select:focus { border-color: rgba(169,156,255,.58); background: rgba(8,8,20,.74); box-shadow: 0 0 0 3px rgba(120,103,242,.11); }
.filter-row { gap: 6px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  min-height: 34px;
  border-color: var(--line);
  border-radius: 999px;
  color: #8e93a7;
  background: rgba(255,255,255,.025);
  font-weight: 650;
  transition: transform 140ms var(--ease-out), border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}
.filter-chip.is-active { border-color: rgba(169,156,255,.22); color: #e5e2ff; background: rgba(120,103,242,.13); }
.filter-chip:active { transform: scale(.97); }
.accounts-list { gap: 8px; }
.account-card {
  border-color: var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(13,14,27,.92), rgba(8,9,19,.94));
  box-shadow: inset 0 1px rgba(255,255,255,.025);
  animation: account-enter 220ms var(--ease-out) both;
  transition: transform 180ms var(--ease-out), border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}
.account-card:nth-child(2) { animation-delay: 35ms; }
.account-card:nth-child(3) { animation-delay: 70ms; }
.account-card:nth-child(4) { animation-delay: 105ms; }
.account-card:nth-child(n+5) { animation-delay: 120ms; }
.account-card.running { border-color: rgba(73,217,154,.16); }
.account-card.problem { border-color: rgba(255,107,129,.19); }
.account-accent { width: 3px; background: rgba(255,255,255,.08); }
.account-main { padding: 14px; }
.account-avatar {
  width: 40px;
  height: 40px;
  border-color: var(--line);
  border-radius: 12px;
  color: #c3c6d7;
  background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
}
.account-card.running .account-avatar { color: #8ceaba; background: rgba(73,217,154,.08); box-shadow: inset 0 1px rgba(255,255,255,.05); }
.account-name { font-size: 13px; font-weight: 700; }
.account-subtitle,
.owner-line { color: #777c91; font-size: 9px; }
.status-pill { border-radius: 999px; font-weight: 700; }
.account-tags span { border: 1px solid rgba(255,255,255,.045); border-radius: 999px; background: rgba(255,255,255,.035); }
.account-metrics { border-top-color: rgba(255,255,255,.055); }
.metric strong { font-size: 13px; font-weight: 700; }
.account-actions { gap: 7px; padding: 10px 11px; border-top-color: rgba(255,255,255,.055); background: rgba(255,255,255,.018); }

.modal-backdrop { background: rgba(2,3,10,.76); backdrop-filter: blur(12px) saturate(125%); }
.detail-sheet,
.login-sheet {
  border-color: rgba(255,255,255,.13);
  border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, rgba(25,26,44,.98), rgba(12,13,25,.99));
  box-shadow: 0 -20px 70px rgba(0,0,0,.42), inset 0 1px rgba(255,255,255,.06);
  animation: sheet-enter-v9 280ms var(--ease-drawer) both;
}
.sheet-handle { background: rgba(255,255,255,.18); }
.detail-tabs { border-color: var(--line); border-radius: 12px; background: rgba(2,3,10,.52); }
.detail-tabs button { border-radius: 9px; transition: transform 140ms var(--ease-out), color 160ms ease, background-color 160ms ease; }
.detail-tabs button.is-active { color: white; background: rgba(255,255,255,.085); box-shadow: inset 0 1px rgba(255,255,255,.055); }
.detail-tabs button:active { transform: scale(.97); }
.switch { background: rgba(255,255,255,.14); transition: background-color 180ms ease; }
.switch::after { transition: transform 220ms var(--ease-out); }
.switch-field input:checked + .switch { background: var(--primary); }
.feature-card,
.compact-row,
.analytics-hero,
.mini-stats div,
.history-chart { border-color: var(--line); background: rgba(3,4,12,.42); }
.feature-card { border-radius: 13px; transition: transform 160ms var(--ease-out), border-color 160ms ease, background-color 160ms ease; }
.feature-card:active { transform: scale(.985); }
.feature-icon { border-radius: 10px; color: #aeb2c4; background: rgba(255,255,255,.055); }
.upload-zone { border-color: var(--line-strong); border-radius: 13px; background: rgba(3,4,12,.42); }
.toast {
  border-color: rgba(255,255,255,.13);
  border-radius: 13px;
  background: rgba(26,27,44,.94);
  box-shadow: 0 18px 50px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.06);
  backdrop-filter: blur(18px);
}
.sticky-save { border-top-color: var(--line); background: linear-gradient(180deg, rgba(12,13,25,0), rgba(12,13,25,.97) 26%); }
.loader-logo,
.error-symbol { border-color: rgba(255,255,255,.14); border-radius: 18px; background: linear-gradient(145deg, rgba(120,103,242,.22), rgba(255,255,255,.045)); box-shadow: 0 16px 42px rgba(0,0,0,.25); }
.empty-state { border-color: var(--line); border-radius: 14px; background: rgba(3,4,12,.4); }

@keyframes account-enter {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
}
@keyframes sheet-enter-v9 {
  from { opacity: 0; transform: translateY(100%); }
}

@media (hover: hover) and (pointer: fine) {
  .icon-button:hover { border-color: var(--line-strong); color: white; background: rgba(255,255,255,.075); }
  .stat-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
  .account-card:hover { border-color: rgba(169,156,255,.2); background: linear-gradient(145deg, rgba(19,20,36,.95), rgba(10,11,23,.96)); box-shadow: 0 12px 32px rgba(0,0,0,.15); transform: translateY(-1px); }
  .filter-chip:hover { border-color: var(--line-strong); color: #c4c7d6; }
  .feature-card:hover { border-color: var(--line-strong); background: rgba(255,255,255,.035); }
}

@media (max-width: 430px) {
  .app-shell { padding-right: 11px; padding-left: 11px; }
  .profile-card { padding: 15px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-panel { align-items: stretch; }
  .bulk-actions { display: grid; grid-template-columns: 1.35fr 1fr 1fr; width: 100%; }
  .accounts-section { padding: 14px; }
  .filter-row { margin-right: -14px; padding-right: 14px; overflow-x: auto; flex-wrap: nowrap; }
  .filter-chip { flex: 0 0 auto; }
  .account-actions .button { padding-right: 10px; padding-left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .account-card,
  .detail-sheet,
  .login-sheet { animation: fade-enter 180ms ease both; }
  .button,
  .icon-button,
  .filter-chip,
  .feature-card,
  .segmented button,
  .detail-tabs button { transition-property: border-color, background-color, color, opacity; }
}
@keyframes fade-enter { from { opacity: 0; } }

/* v10 ? mobile-first Telegram layout and sheets */
html {
  min-height: var(--app-height, 100dvh);
  overscroll-behavior-y: none;
}
body {
  min-height: var(--app-height, 100dvh);
  -webkit-text-size-adjust: 100%;
  overflow-wrap: anywhere;
}
body.sheet-open {
  position: fixed;
  right: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
button,
input,
select,
textarea { touch-action: manipulation; }

.modal-backdrop {
  padding-top: max(8px, env(safe-area-inset-top));
  opacity: 0;
  pointer-events: none;
  overscroll-behavior: contain;
  transition: opacity 200ms var(--ease-out);
}
.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.modal-backdrop.is-closing {
  opacity: 0;
  pointer-events: none;
}
.detail-sheet,
.login-sheet {
  animation: none;
  opacity: .98;
  transform: translateY(100%);
  will-change: transform;
  transition: transform 280ms var(--ease-drawer), opacity 180ms ease;
}
.modal-backdrop.is-open > .detail-sheet,
.modal-backdrop.is-open > .login-sheet {
  opacity: 1;
  transform: translateY(0);
}
.modal-backdrop.is-closing > .detail-sheet,
.modal-backdrop.is-closing > .login-sheet {
  opacity: .98;
  transform: translateY(100%);
}
.detail-sheet {
  height: calc(var(--app-height, 100dvh) - max(8px, env(safe-area-inset-top)));
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-padding-top: 58px;
  scroll-padding-bottom: calc(92px + var(--safe-bottom));
  scrollbar-width: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.detail-sheet::-webkit-scrollbar,
.login-sheet::-webkit-scrollbar { display: none; }
.login-sheet {
  max-height: calc(var(--app-height, 100dvh) - max(12px, env(safe-area-inset-top)));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.detail-tabs {
  position: sticky;
  z-index: 6;
  top: -1px;
  display: flex;
  grid-template-columns: none;
  justify-content: flex-start;
  gap: 6px;
  margin: 8px -14px 14px;
  padding: 7px 14px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-padding-inline: 14px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  background: linear-gradient(180deg, rgba(18,19,34,.98) 0%, rgba(18,19,34,.92) 78%, rgba(18,19,34,0) 100%);
  backdrop-filter: blur(18px) saturate(140%);
}
.detail-tabs button {
  flex: 0 0 auto;
  min-width: max-content;
  min-height: 38px;
  padding: 0 13px;
  scroll-snap-align: center;
}
.tab-page { min-width: 0; min-height: 0; }

@media (max-width: 560px) {
  .app-shell { padding: max(8px, env(safe-area-inset-top)) 10px calc(24px + var(--safe-bottom)); }
  .topbar { min-height: 52px; margin-bottom: 10px; }
  .icon-button { width: 44px; height: 44px; }
  .profile-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 4px 12px;
    min-height: 0;
    padding: 14px;
  }
  .avatar { grid-row: 1 / 3; width: 52px; height: 52px; }
  .profile-copy { min-width: 0; }
  .profile-copy h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .access-badge { grid-column: 2; justify-self: start; max-width: 100%; }
  .scope-panel { align-items: stretch; flex-direction: column; }
  .segmented { align-self: stretch; }

  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card,
  .stat-card.stat-primary,
  .stat-card.stat-danger { min-width: 0; min-height: 86px; }

  .bulk-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .bulk-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .bulk-actions .button { width: 100%; min-width: 0; min-height: 46px; padding-inline: 10px; }
  .bulk-actions .button:first-child { grid-column: 1 / -1; }

  .accounts-section { padding: 13px; }
  .search-box { height: 48px; }
  .search-box input,
  .field-control input,
  .textarea,
  .select,
  .inline-form input { font-size: 16px; }
  .filter-row {
    margin-right: -13px;
    padding-right: 13px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .filter-chip { min-height: 38px; scroll-snap-align: start; }

  .account-main { padding: 13px; }
  .account-head { align-items: flex-start; }
  .status-pill { max-width: 38%; white-space: normal; text-align: center; }
  .account-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
    gap: 6px;
    padding: 9px;
  }
  .account-actions .button { min-width: 0; min-height: 44px; padding-inline: 8px; font-size: 10px; }

  .modal-backdrop { align-items: flex-end; padding-top: max(6px, env(safe-area-inset-top)); }
  .detail-sheet,
  .login-sheet {
    width: 100%;
    border-right: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
    padding-right: 14px;
    padding-left: 14px;
  }
  .detail-sheet { height: calc(var(--app-height, 100dvh) - max(6px, env(safe-area-inset-top))); }
  .login-sheet { max-height: calc(var(--app-height, 100dvh) - max(10px, env(safe-area-inset-top))); }
  .sheet-handle { position: sticky; z-index: 8; top: 0; margin-bottom: 10px; }
  .detail-header { align-items: flex-start; }
  .detail-title h2 { font-size: 18px; }
  .detail-status-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .detail-status-row .status-pill { grid-column: 1 / -1; justify-self: start; max-width: none; }
  .detail-status-row .button { width: 100%; min-width: 0; min-height: 44px; padding-inline: 9px; }
  .detail-tabs { display: flex; grid-template-columns: none; }
  .form-grid,
  .form-grid.three { grid-template-columns: minmax(0, 1fr); }
  .inline-form,
  .row-actions,
  .action-grid { grid-template-columns: minmax(0, 1fr); }
  .inline-form .button,
  .row-actions .button,
  .action-grid .button { width: 100%; min-height: 46px; }
  .check-grid { grid-template-columns: minmax(0, 1fr); }
  .switch-field { align-items: flex-start; }
  .compact-row { align-items: flex-start; flex-wrap: wrap; }
  .compact-row-main { min-width: min(100%, 180px); }
  .sticky-save { z-index: 9; }
}

@media (max-width: 360px) {
  .brand-subtitle { display: none; }
  .summary-grid { gap: 7px; }
  .stat-card strong { font-size: 22px; }
  .account-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .account-actions .check-button { grid-column: 1 / -1; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .detail-sheet,
  .login-sheet { border-radius: 18px 18px 0 0; }
  .detail-sheet { height: var(--app-height, 100dvh); }
  .profile-card { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop { transition: opacity 180ms ease; }
  .detail-sheet,
  .login-sheet { transform: none; transition: opacity 180ms ease; }
  .modal-backdrop.is-open > .detail-sheet,
  .modal-backdrop.is-open > .login-sheet { transform: none; }
  .modal-backdrop.is-closing > .detail-sheet,
  .modal-backdrop.is-closing > .login-sheet { transform: none; opacity: 0; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar,
  .detail-tabs,
  .modal-backdrop { backdrop-filter: none; }
  .topbar { background: #070812; }
  .detail-tabs { background: #121322; }
  .detail-sheet,
  .login-sheet { background: #111221; }
}

/* v11 ? stable tabs and detail-page bug fixes */
#fullSettingsForm {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#fullSettingsForm > .tab-page { order: 1; }
#fullSettingsForm > .sticky-save { order: 2; }

.detail-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  margin: 8px -14px 14px;
  padding: 7px 14px 8px;
  overflow: visible;
  scroll-snap-type: none;
  background: rgba(18, 19, 34, .96);
}
.detail-tabs button {
  min-width: 0;
  min-height: 40px;
  padding: 0 6px;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-card { animation: none; }
.account-card:nth-child(n) { animation-delay: 0ms; }
.subsection-head > div,
.analytics-copy,
.compact-row-main { min-width: 0; }
.subsection-head h3,
.analytics-copy span,
.field small { overflow-wrap: anywhere; }
.progress-track i {
  width: 100%;
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  transition: transform 300ms var(--ease-out);
}
.history-chart,
.mini-stats,
.analytics-hero { min-width: 0; max-width: 100%; }
.switch { display: inline-block; }
.mini-toggle { width: 42px; height: 25px; }
.compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.compact-row > label {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 34px;
}

@media (max-width: 560px) {
  .detail-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }
  .detail-tabs button {
    min-height: 39px;
    padding-inline: 4px;
    font-size: 9px;
  }
  .analytics-hero { align-items: flex-start; gap: 12px; padding: 12px; }
  .success-ring { width: 76px; height: 76px; }
  .history-chart { gap: 4px; padding-inline: 6px; }
  .chart-column strong,
  .chart-column span { font-size: 7px; }
  .compact-row { align-items: center; }
  .compact-row-main { min-width: 0; }
}

@media (max-width: 340px) {
  .detail-tabs button { font-size: 8px; }
  .analytics-hero { display: grid; grid-template-columns: 76px minmax(0, 1fr); }
  .mini-stats { grid-template-columns: minmax(0, 1fr); }
}

