:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #d8e0eb;
  --line-strong: #bfccda;
  --text: #102033;
  --muted: #66758b;
  --brand: #1d8f83;
  --brand-strong: #166f67;
  --blue: #2f80d8;
  --warn: #b7791f;
  --danger: #b42318;
  --ok: #157347;
  --shadow: 0 10px 28px rgba(15, 32, 51, 0.08);
  font-family:
    Inter, "Noto Sans SC", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: #eef2f6;
}

.login-panel {
  width: min(420px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-brand {
  padding: 22px 26px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  color: var(--brand);
  font-size: 22px;
}

.login-brand span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.login-panel form {
  display: grid;
  gap: 16px;
  padding: 26px;
}

.login-panel form .btn {
  width: 100%;
  margin-top: 2px;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fff;
}

.brand {
  height: 78px;
  display: grid;
  align-content: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.brand strong {
  display: block;
  color: var(--brand);
  font-size: 22px;
  line-height: 1.1;
}

.brand span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  padding: 16px 12px;
  overflow: auto;
}

.nav-group {
  margin-bottom: 14px;
}

.nav-title {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.nav a {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 8px 12px;
  border-radius: 8px;
  color: #2f4057;
  font-size: 14px;
}

.nav a:hover,
.nav a.active {
  color: var(--brand-strong);
  background: #e8f5f2;
}

.main {
  min-width: 0;
}

.topbar {
  height: 78px;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 4;
}

.topbar-title {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-user {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.page {
  width: calc(100% - 40px);
  max-width: none;
  margin: 0 auto;
  padding: 24px 0 42px;
}

.desktop-page {
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

h1,
h2,
h3,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

.sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.panel,
.metric,
.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

.hero {
  padding: 22px 24px;
  background: #17495a;
  color: #fff;
}

.hero a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.hero span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.metric {
  padding: 15px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.quota-metric {
  min-width: 0;
}

.quota-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quota-title > span {
  margin-bottom: 8px;
}

.quota-refresh {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 24px;
}

.quota-refresh:hover:not(:disabled) {
  background: var(--panel-soft);
  color: var(--brand);
}

.quota-refresh:disabled {
  cursor: wait;
  opacity: 0.45;
}

.quota-meter {
  height: 5px;
  margin: 11px 0 9px;
  overflow: hidden;
  border-radius: 3px;
  background: #e4eceb;
}

.quota-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.quota-metric.exhausted .quota-meter i,
.quota-metric.unavailable .quota-meter i {
  background: var(--danger);
}

.quota-metric .quota-account-note {
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quota-metric small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar,
.panel-head,
.row-actions,
.tabs,
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.filters {
  align-items: end;
  margin-bottom: 12px;
}

.scrape-account-filters {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.scrape-account-filters label {
  min-width: 0;
}

.posts-filter-panel {
  padding: 16px;
}

.posts-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.batch-filter-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.posts-filter-button {
  width: 100%;
}

.post-site-field {
  min-width: 0;
  align-self: start;
  color: var(--muted);
  font-size: 12px;
}
.posts-filter-panel:has(.post-site-field) .posts-filter-grid { align-items: start; }

.post-site-picker { position: relative; margin-top: 6px; }
.post-site-picker summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #071924;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.post-site-picker summary::-webkit-details-marker { display: none; }
.post-site-picker summary::after { content: "\2304"; margin-left: 8px; }
.post-site-picker summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.post-site-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #0b2333;
  box-shadow: 0 8px 24px #0008;
}
.post-site-options label { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 8px; color: var(--text); cursor: pointer; }
.post-site-options label:hover { background: #143b51; }
.post-site-options label span { overflow-wrap: anywhere; }
.post-site-options input { width: 16px; height: 16px; min-height: 0; margin: 0; flex: 0 0 16px; accent-color: #159fc5; }
.post-site-options .post-site-all { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.post-site-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.post-site-tags:not(:empty) { margin-top: 6px; }
.post-site-tag { display: inline-flex; align-items: center; max-width: 100%; gap: 4px; padding: 2px 5px 2px 8px; border: 1px solid #236078; border-radius: 4px; background: #103446; color: var(--text); }
.post-site-tag > span { overflow-wrap: anywhere; min-width: 0; }
.post-site-tag button { width: 22px; height: 22px; flex: 0 0 22px; padding: 0; border: 0; background: transparent; color: #a5d2e2; cursor: pointer; font-size: 18px; line-height: 1; }
.post-site-tag button:hover { color: white; background: #21556b; }

.posts-table-panel {
  margin-top: 16px;
  padding: 0;
  overflow: hidden;
}

.post-share-result:not(:empty) {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 16px 14px;
}

.post-share-result label {
  flex: 1;
  min-width: 180px;
}

.posts-summary-panel .panel-head {
  flex-wrap: wrap;
  gap: 10px;
}

.posts-summary-panel .toolbar {
  flex-wrap: wrap;
}

.posts-summary-panel {
  margin-top: 16px;
  padding: 0;
  overflow: hidden;
}

.posts-summary-panel .panel-head {
  margin: 0;
  padding: 14px 16px;
}

.posts-summary-panel .table-wrap {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
}

.posts-summary-table {
  min-width: 840px;
}

.posts-summary-table td {
  color: #dcefff;
  font-size: 15px;
  font-weight: 700;
}

.posts-table-panel .table-wrap {
  border: 0;
  border-radius: 0;
}

.analytics-posts-panel {
  padding: 0;
  overflow: hidden;
}

.analytics-posts-panel .panel-head {
  margin: 0;
  padding: 16px;
}

.analytics-posts-panel .table-wrap {
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.posts-pagination {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.posts-pagination strong {
  min-width: 86px;
  color: var(--text);
  text-align: center;
  font-size: 13px;
}

.pagination-jump {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  white-space: nowrap;
}

.pagination-jump input {
  width: 52px;
  min-height: 36px;
  padding: 0 5px;
  text-align: center;
  font-weight: 700;
}

.pagination-jump .btn {
  min-width: 52px;
  padding: 0 9px;
}

.posts-pagination .btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.posts-data-table {
  min-width: 1500px;
  table-layout: fixed;
}

.posts-data-table th,
.posts-data-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

.posts-data-table th {
  white-space: nowrap;
}

.posts-data-table th:nth-child(1) { width: 92px; }
.posts-data-table th:nth-child(2) { width: 110px; }
.posts-data-table th:nth-child(3) { width: 88px; }
.posts-data-table th:nth-child(4) { width: 96px; }
.posts-data-table th:nth-child(5) { width: 112px; }
.posts-data-table th:nth-child(6) { width: 165px; }
.posts-data-table th:nth-child(7) { width: 430px; }
.posts-data-table th:nth-child(n+8):nth-child(-n+12) { width: 70px; }
.posts-data-table th:nth-child(13) { width: 120px; }

.posts-data-table td:nth-child(5),
.posts-data-table td:nth-child(6),
.posts-data-table td:nth-child(n+8) {
  white-space: nowrap;
}

.post-list-content {
  min-width: 0;
}

.post-list-content > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-list-content .post-detail-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-list-content small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #8290a5;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 86px;
  padding: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 143, 131, 0.12);
}

.btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.btn.warn {
  border-color: #f4d69b;
  background: #fff9e8;
  color: var(--warn);
}

.btn.danger {
  border-color: #f5c2bd;
  background: #fff1f0;
  color: var(--danger);
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef3f8;
  color: #506177;
  font-size: 12px;
  font-weight: 700;
}

.tag.success,
.tag.active {
  background: #e7f6ee;
  color: var(--ok);
}

.tag.failed {
  background: #fff1f0;
  color: var(--danger);
}

.tag.cancelled {
  background: #f1f3f5;
  color: #667085;
}

.tag.running,
.tag.queued {
  background: #eef6ff;
  color: var(--blue);
}

.tag.pending,
.tag.needs_config,
.tag.disabled {
  background: #fff8e6;
  color: var(--warn);
}

.account-status-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 92px;
}

.account-status-cell small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.account-number-cell {
  position: relative;
  min-width: 46px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.account-number-cell > strong,
.fingerprint-inline-trigger > strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.account-number-cell > small,
.fingerprint-inline-trigger > small {
  max-width: 92px;
  overflow: hidden;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fingerprint-inline-trigger {
  min-width: 32px;
  min-height: 34px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  margin: -5px -6px;
  padding: 5px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.fingerprint-inline-trigger:hover,
.account-number-cell.is-editing .fingerprint-inline-trigger {
  border-color: rgba(30, 200, 255, 0.35);
  background: rgba(30, 200, 255, 0.08);
}

.fingerprint-inline-editor {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  left: -7px;
  width: 236px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px 30px;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-raised, var(--panel));
  box-shadow: var(--shadow);
}

.fingerprint-inline-editor input {
  min-width: 0;
  min-height: 30px;
  height: 30px;
  padding: 0 8px;
}

.fingerprint-inline-save,
.fingerprint-inline-cancel {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #081826;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.fingerprint-inline-save {
  border-color: rgba(47, 226, 168, 0.45);
  color: var(--ok);
}

.fingerprint-inline-cancel:hover {
  border-color: rgba(255, 102, 119, 0.5);
  color: var(--danger);
}

.fingerprint-inline-save:hover {
  background: rgba(47, 226, 168, 0.1);
}

.accounts-table td:first-child {
  overflow: visible;
}

.accounts-table th:first-child,
.accounts-table td:first-child {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.accounts-table input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
  vertical-align: middle;
}

.account-status-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  color: var(--muted);
}

.account-status-bulk-actions .toolbar {
  margin-left: auto;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: #a9c1d1;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.platform-badge > i {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #28516d;
  border-radius: 6px;
  background: #0b2940;
  color: #dff5ff;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.platform-badge.platform-x > i {
  border-color: #526878;
  background: #17232d;
  color: #ffffff;
}

.platform-badge.platform-youtube > i {
  border-color: #7a3440;
  background: #351a23;
  color: #ff6573;
  font-size: 10px;
}

.platform-badge.platform-tiktok > i {
  border-color: #246c6a;
  background: #102f35;
  color: #43e1d1;
  text-shadow: 1px 1px 0 #e05b99;
}

.platform-badge.platform-instagram > i {
  border-color: #694783;
  background: #2c203d;
  color: #e19aff;
  font-size: 14px;
}

.platform-badge.platform-facebook > i {
  border-color: #315f9c;
  background: #182d51;
  color: #6aa9ff;
  font-family: Arial, sans-serif;
  font-size: 15px;
}

.platform-badge.platform-manual > i,
.platform-badge.platform-other > i {
  border-color: #3c5365;
  background: #182633;
  color: #91a8b8;
}

.site-account-count {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 104px;
}

.site-account-count strong {
  font-size: 14px;
}

.site-account-count small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.project-summary-table {
  min-width: 820px;
}

.uv-summary-cell {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.uv-summary-cell strong {
  color: #dcefff;
  font-size: 13px;
}

.uv-summary-cell small {
  font-size: 11px;
}

.uv-summary-cell .increase {
  color: var(--success);
}

.uv-summary-cell .decrease {
  color: var(--danger);
}

.uv-summary-cell .neutral {
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 13px;
}

.accounts-table {
  min-width: 1120px;
}

.account-followers-sort,
.post-views-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.account-followers-sort i {
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  line-height: 1;
}

.post-views-sort i { width: 12px; color: var(--brand); font-size: 12px; font-style: normal; line-height: 1; }
.post-views-sort:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.post-views-sort:disabled { cursor: wait; opacity: .6; }

.accounts-table th:nth-last-child(-n+4),
.accounts-table td:nth-last-child(-n+4) {
  white-space: nowrap;
}

.account-status-filter {
  position: relative;
  display: flex;
  align-items: center;
  width: max-content;
  padding-right: 12px;
  cursor: pointer;
}

.account-status-filter::after {
  position: absolute;
  top: 50%;
  right: 1px;
  width: 0;
  height: 0;
  border-top: 4px solid #718096;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
  content: "";
  transform: translateY(-35%);
}

.account-status-filter select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  opacity: 0;
  cursor: pointer;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: var(--panel-soft);
  font-weight: 700;
}

td a {
  color: var(--brand-strong);
}

.url-cell {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eaf7f4;
}

.quick-card.planned {
  background: #fff9e8;
  border-color: #f2dda0;
}

.quick-card strong {
  font-size: 16px;
}

.quick-card span {
  color: var(--muted);
  font-size: 12px;
}

.chart {
  min-height: 220px;
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 16px 6px 0;
  border-top: 1px solid var(--line);
  justify-content: flex-start;
}

.bar {
  flex: 1;
  min-width: 26px;
  max-width: 80px;
  display: grid;
  align-items: end;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.bar i {
  display: block;
  min-height: 8px;
  border-radius: 6px 6px 0 0;
  background: #2f80d8;
}

.analytics-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.analytics-loading {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.analytics-periods {
  display: flex;
  align-items: center;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.segmented .btn {
  border-color: transparent;
  background: transparent;
}

.segmented .btn.primary {
  background: var(--brand);
  color: #fff;
}

.compact-filters {
  justify-content: flex-end;
  margin-bottom: 0;
}

.compact-filters label {
  min-width: 132px;
}

.secondary-metrics {
  margin-top: 14px;
}

.schedule-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.schedule-strip > div {
  min-width: 0;
  padding: 14px 16px;
  background: #fff;
}

.schedule-strip span,
.schedule-strip strong {
  display: block;
}

.schedule-strip span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.schedule-strip strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.success-notice {
  margin-top: 14px;
  border-color: #b8ddd4;
  background: #eef9f6;
  color: #166f67;
}

.error-text {
  max-width: 240px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--danger);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag[title] {
  cursor: help;
}

.post-detail-link {
  font-weight: 700;
}

.external-link {
  margin-left: 4px;
  font-size: 15px;
}

.post-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.post-detail-main,
.post-detail-side {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.post-detail-main > .panel,
.post-detail-side > .panel {
  min-width: 0;
}

.post-detail-main .table-wrap {
  max-width: 100%;
}

.post-overview {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  min-height: 220px;
}

.post-media {
  width: 150px;
  aspect-ratio: 9 / 16;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111827;
}

.post-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.post-media.empty-media {
  display: grid;
  place-items: center;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
}

.post-copy {
  min-width: 0;
  padding: 4px 0;
}

.post-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.original-post-link {
  display: block;
  margin-top: 12px;
  overflow-wrap: anywhere;
  color: var(--brand-strong);
  font-size: 13px;
}

.post-title {
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.detail-hashtag {
  padding: 4px 7px;
  border-radius: 4px;
  background: #eaf4fb;
  color: #27648b;
  font-size: 12px;
}

.source-badge {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  background: #eee5ff;
  color: #7c3aed;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.post-music {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.detail-pairs {
  display: grid;
  gap: 11px;
}

.detail-pair {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1.4fr);
  gap: 12px;
  align-items: start;
  font-size: 13px;
}

.detail-pair span {
  color: var(--muted);
}

.detail-pair strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-weight: 500;
}

.detail-pair a {
  color: var(--brand-strong);
}

.detail-divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

.detail-caption {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.comment-list {
  display: grid;
}

.comment-row {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.comment-row:first-child {
  padding-top: 0;
}

.comment-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.comment-row > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-row p {
  margin-top: 7px;
  line-height: 1.6;
}

.comment-row > span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.split {
  display: grid;
  grid-template-columns: minmax(340px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.split > * {
  min-width: 0;
}

.split > form.panel {
  position: sticky;
  top: 94px;
}

.account-secret-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.account-secret-field input {
  min-width: 0;
}

.account-secret-actions {
  display: flex;
  gap: 7px;
}

.account-secret-toggle,
.account-secret-copy {
  width: 58px;
  padding: 0;
}

.account-secret-copy[hidden] {
  display: none !important;
}

.split > .panel .filters label {
  flex: 1 1 150px;
}

.notice {
  padding: 12px;
  border: 1px solid #f2dda0;
  border-radius: 8px;
  background: #fffaf0;
  color: #7a5200;
  font-size: 13px;
}

.permission-panel {
  max-width: 620px;
}

.permission-panel .btn {
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #102033;
  color: #fff;
  box-shadow: var(--shadow);
}

.mobile-menu {
  display: none;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    display: none;
  }

  .nav-open .nav {
    display: grid;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .cols-6,
  .cols-5,
  .cols-4,
  .cols-3,
  .cols-2,
  .split,
  .quick-grid,
  .post-detail-layout {
    grid-template-columns: 1fr;
  }

  .split > form.panel {
    position: static;
  }

  .analytics-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-filters {
    justify-content: stretch;
  }

  .compact-filters label {
    flex: 1 1 180px;
  }

  .posts-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scrape-account-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .schedule-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .page {
    width: calc(100% - 20px);
    padding-top: 16px;
  }

  .topbar {
    padding: 0 12px;
  }

  h1 {
    font-size: 22px;
  }

  .segmented {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-strip {
    grid-template-columns: 1fr;
  }

  .post-overview {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
  }

  .post-media {
    width: 96px;
  }
}

/* DataScout-inspired desktop theme */
:root {
  --bg: #06111d;
  --panel: #0a1b2d;
  --panel-soft: #081827;
  --panel-raised: #0c2238;
  --line: #153b57;
  --line-strong: #245675;
  --text: #e8f4ff;
  --muted: #7893aa;
  --brand: #1ec8ff;
  --brand-strong: #76ddff;
  --blue: #4b83ff;
  --warn: #ffbd4a;
  --danger: #ff6677;
  --ok: #2fe2a8;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
  color-scheme: dark;
}

html {
  background: var(--bg);
}

body {
  min-width: 1180px;
  background: var(--bg);
  color: var(--text);
}

body,
button,
input,
select,
textarea {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #245675 #071522;
}

*::selection {
  background: rgba(30, 200, 255, 0.28);
  color: #fff;
}

.layout {
  min-width: 1180px;
  grid-template-columns: 232px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  border-color: rgba(76, 148, 190, 0.2);
  background: #06111e;
}

.brand {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-color: rgba(90, 140, 173, 0.16);
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid #35b9e8;
  border-radius: 8px;
  background: #159ed1;
  color: #04101c;
  box-shadow: 0 0 22px rgba(30, 200, 255, 0.2);
  font-size: 17px;
  font-weight: 900;
}

.brand-copy {
  min-width: 0;
}

.brand strong,
.login-brand strong {
  color: var(--text);
  font-size: 17px;
  letter-spacing: 0;
}

.brand span,
.login-brand span {
  margin-top: 3px;
  color: #607f99;
  font-size: 11px;
}

.nav {
  padding: 14px 12px;
}

.nav-group {
  margin-bottom: 16px;
}

.nav-title {
  padding: 8px 10px 6px;
  color: #4d6a82;
  font-size: 11px;
  font-weight: 700;
}

.nav a {
  position: relative;
  min-height: 42px;
  gap: 11px;
  margin: 3px 0;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #8ca4b8;
  font-size: 13px;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.nav a > span:first-child {
  width: 18px;
  color: #6d8ba3;
  text-align: center;
  font-size: 15px;
}

.nav a:hover {
  border-color: #174766;
  background: #0b2134;
  color: #e5f7ff;
}

.nav a.active {
  border-color: #2f82bc;
  background: #123b65;
  color: #fff;
  box-shadow: 0 8px 22px rgba(14, 85, 147, 0.18);
}

.nav a.active > span:first-child {
  color: var(--brand);
}

.main {
  background: var(--bg);
}

.topbar {
  height: 76px;
  min-height: 76px;
  padding: 0 20px;
  border-color: rgba(76, 148, 190, 0.18);
  background: rgba(6, 17, 29, 0.95);
  backdrop-filter: blur(12px);
}

.topbar-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-accent {
  width: 4px;
  height: 30px;
  flex: 0 0 4px;
  border-radius: 3px;
  background: var(--brand);
  box-shadow: 0 0 13px rgba(30, 200, 255, 0.45);
}

.topbar-title,
.topbar-subtitle {
  display: block;
}

.topbar-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 750;
}

.topbar-subtitle {
  margin-top: 4px;
  overflow: hidden;
  color: #58758c;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-user {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #bcd1df;
  font-size: 12px;
}

.current-user > i {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid #2a688d;
  border-radius: 50%;
  background: #0d304a;
  color: var(--brand);
  font-style: normal;
  font-weight: 800;
}

.current-user > span,
.current-user small {
  display: block;
}

.current-user small {
  margin-top: 2px;
  color: #5e7e95;
  font-size: 9px;
  font-weight: 500;
}

.page {
  width: calc(100% - 40px);
  padding: 20px 0 36px;
}

.page-head {
  margin-bottom: 14px;
}

h1 {
  color: #f1f8ff;
  font-size: 24px;
  font-weight: 780;
}

h2 {
  color: #e2f2fc;
  font-size: 16px;
}

h3 {
  color: #d9ebf7;
  font-size: 14px;
}

.sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.panel,
.metric,
.hero,
.login-panel {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 15px;
}

.panel-head {
  margin-bottom: 12px;
}

.panel-head h2 {
  font-size: 15px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  border-color: #216085;
  background: #0d314e;
}

.hero::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 34%;
  height: 3px;
  background: var(--brand);
  content: "";
}

.hero strong {
  margin-top: 5px;
  color: #fff;
  font-size: 25px;
}

.hero span {
  color: #9ec7dd;
  font-size: 12px;
}

.metric {
  position: relative;
  min-height: 104px;
  overflow: hidden;
  padding: 16px;
  background: #091d30;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.metric::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: #1f648d;
  content: "";
}

.metric:hover {
  border-color: #246b96;
  transform: translateY(-1px);
}

.metric span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  color: #f1f8ff;
  font-size: 27px;
  line-height: 1.05;
}

.metric strong + span {
  margin-top: 7px;
  margin-bottom: 0;
  color: #628199;
  font-size: 10px;
}

.metric.metric-trend-up::before {
  background: #2ac98f;
}

.metric.metric-trend-down::before {
  background: #f05f6b;
}

.metric.metric-trend-flat::before {
  background: #698398;
}

.metric-change {
  display: flex !important;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
}

.metric-change i {
  display: inline-flex;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.metric-change b {
  flex: 0 0 auto;
  font-size: 11px;
}

.metric-change em {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-change.up,
.metric-change.up b {
  color: #50dba6 !important;
}

.metric-change.up i {
  background: rgba(42, 201, 143, 0.16);
  color: #5ce3af;
}

.metric-change.down,
.metric-change.down b {
  color: #ff7c86 !important;
}

.metric-change.down i {
  background: rgba(240, 95, 107, 0.16);
  color: #ff8790;
}

.metric-change.flat,
.metric-change.flat b {
  color: #91a8ba !important;
}

.metric-change.flat i {
  background: rgba(105, 131, 152, 0.18);
  color: #a4bacb;
}

.metric-note,
.metric-context {
  display: block;
  margin-top: 7px;
  margin-bottom: 0 !important;
  color: #6f8ba1 !important;
  font-size: 10px !important;
}

.metric-context {
  margin-top: 4px;
}

.toolbar,
.row-actions,
.tabs,
.filters {
  gap: 9px;
}

label {
  color: #809bb0;
  font-size: 12px;
}

input,
select,
textarea {
  min-height: 38px;
  border-color: #1e4c6a;
  border-radius: 7px;
  background: #071724;
  color: #d9edf8;
}

input::placeholder,
textarea::placeholder {
  color: #48677f;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #2a678c;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 200, 255, 0.11);
}

input[type="checkbox"] {
  accent-color: var(--brand);
}

.btn {
  min-height: 36px;
  border-color: #1e4c6a;
  border-radius: 7px;
  background: #081826;
  color: #b7ccdb;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.btn:hover {
  border-color: #3180aa;
  background: #0c2133;
  color: #effaff;
}

.btn.primary {
  border-color: #229ed0;
  background: #147db8;
  color: #fff;
  box-shadow: 0 7px 18px rgba(20, 125, 184, 0.18);
}

.btn.primary:hover {
  border-color: #4bd1ff;
  background: #178bc9;
}

.btn.warn {
  border-color: #816123;
  background: #2b2415;
  color: #ffd071;
}

.btn.danger {
  border-color: #75404b;
  background: #2a1720;
  color: #ff8d9a;
}

.pill,
.tag {
  min-height: 23px;
  border: 1px solid #244a65;
  background: #0d293e;
  color: #9fb9ca;
  font-size: 11px;
}

.tag.success,
.tag.active {
  border-color: rgba(47, 226, 168, 0.28);
  background: rgba(47, 226, 168, 0.09);
  color: var(--ok);
}

.tag.failed {
  border-color: rgba(255, 102, 119, 0.3);
  background: rgba(255, 102, 119, 0.1);
  color: #ff8290;
}

.tag.cancelled {
  border-color: #33465a;
  background: #182433;
  color: #8999a9;
}

.tag.running,
.tag.queued {
  border-color: rgba(30, 200, 255, 0.3);
  background: rgba(30, 200, 255, 0.1);
  color: var(--brand);
}

.tag.pending,
.tag.needs_config,
.tag.disabled {
  border-color: rgba(255, 189, 74, 0.3);
  background: rgba(255, 189, 74, 0.1);
  color: var(--warn);
}

.table-wrap {
  border-color: var(--line);
  border-radius: 7px;
  background: #081725;
}

table {
  color: #b9cfdd;
}

th,
td {
  border-color: rgba(66, 111, 141, 0.24);
}

th {
  color: #7190a6;
  background: #081a2a;
  font-size: 11px;
}

td {
  color: #b4cad8;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: #0b273e;
}

td a,
.post-detail-link,
.original-post-link,
.detail-pair a {
  color: #42cfff;
}

.post-list-content small {
  color: #658298;
}

.posts-table-panel,
.analytics-posts-panel {
  background: #081725;
}

.posts-pagination {
  border-color: var(--line);
  background: #081827;
  color: #718da2;
}

.posts-pagination strong {
  color: #d9ebf7;
}

.quick-grid {
  gap: 11px;
}

.quick-card {
  position: relative;
  min-height: 92px;
  overflow: hidden;
  border-color: #17435f;
  border-radius: 8px;
  background: #0a2135;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.quick-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--brand);
  content: "";
}

.quick-card:hover {
  border-color: #2879a6;
  transform: translateY(-1px);
}

.quick-card.planned {
  border-color: #665328;
  background: #241f16;
}

.quick-card.planned::before {
  background: var(--warn);
}

.quick-card strong {
  color: #dff4ff;
  font-size: 14px;
}

.quick-card span {
  color: #6e8ba0;
  font-size: 11px;
}

.empty {
  border-color: #24506d;
  border-radius: 7px;
  background: rgba(8, 26, 42, 0.45);
  color: #66859b;
}

.chart {
  border-color: var(--line);
}

.bar {
  color: #6d8a9f;
}

.bar i {
  background: #2a8cd0;
}

.segmented {
  border-color: #1c4966;
  border-radius: 8px;
  background: #071522;
}

.segmented .btn.primary {
  background: #147db8;
}

.schedule-strip {
  border-color: var(--line);
  background: var(--line);
}

.schedule-strip > div {
  background: #091d30;
}

.schedule-strip span {
  color: #6f8da3;
}

.schedule-strip strong {
  color: #e6f3fc;
}

.notice {
  border-color: #5f4b22;
  background: #211c14;
  color: #e7bd6a;
}

.success-notice {
  border-color: #22614f;
  background: #0c2b25;
  color: #5ce9ba;
}

.error-text {
  color: #ff7e8d;
}

.quota-refresh {
  color: #6d8ba0;
}

.quota-refresh:hover:not(:disabled) {
  background: #0f2b42;
  color: var(--brand);
}

.quota-meter {
  background: #0c3047;
}

.quota-meter i {
  background: var(--brand);
}

.post-media {
  border-color: #1e506f;
  background: #050d14;
}

.post-media.empty-media {
  background: #081a2a;
  color: #66859b;
}

.post-meta-line,
.post-music,
.detail-caption,
.detail-pair span,
.comment-row > span {
  color: #7893aa;
}

.post-title,
.comment-row p {
  color: #d9eaf5;
}

.detail-hashtag {
  border: 1px solid #1c4d6d;
  background: #0a2b43;
  color: #73d9ff;
}

.detail-divider,
.comment-row {
  border-color: var(--line);
}

.detail-divider {
  background: var(--line);
}

.source-badge {
  background: #332565;
  color: #bea8ff;
}

.account-status-filter::after {
  border-top-color: #7796ac;
}

.account-status-cell small,
.site-account-count small {
  color: #6f8ba1;
}

.toast {
  border: 1px solid #28739a;
  background: #0b2438;
  color: #e4f6ff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
}

.login-shell {
  min-width: 0;
  background: #06111d;
}

.login-panel {
  width: min(430px, calc(100% - 40px));
  overflow: hidden;
  border-color: #1c4e6c;
  background: #081827;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-color: var(--line);
  background: #071522;
}

.login-panel form {
  padding: 27px;
}

.login-panel h1 {
  font-size: 22px;
}

@media (max-width: 1450px) {
  .layout {
    grid-template-columns: 212px minmax(0, 1fr);
  }

  .brand {
    padding: 0 14px;
  }

  .topbar {
    padding: 0 16px;
  }

  .page {
    width: calc(100% - 30px);
  }

  .topbar-subtitle {
    max-width: 280px;
  }
}
.member-ranking-table {
  min-width: 710px;
}

.member-ranking-table th:first-child,
.member-ranking-table td:first-child {
  width: 66px;
  text-align: center;
}

.member-rank-row {
  transition: background 0.16s ease;
}

.member-rank-row:hover {
  background: rgba(41, 151, 218, 0.07);
}

.member-rank-row.rank-1 {
  background: rgba(240, 183, 55, 0.09);
  box-shadow: inset 3px 0 #efb83f;
}

.member-rank-row.rank-2 {
  background: rgba(167, 190, 207, 0.07);
  box-shadow: inset 3px 0 #a9bdcb;
}

.member-rank-row.rank-3 {
  background: rgba(202, 130, 77, 0.08);
  box-shadow: inset 3px 0 #c98551;
}

.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #355268;
  border-radius: 50%;
  color: #9bb5c8;
  font-weight: 800;
}

.rank-1 .rank-number {
  border-color: #efb83f;
  background: rgba(239, 184, 63, 0.18);
  color: #ffd66d;
}

.rank-2 .rank-number {
  border-color: #a9bdcb;
  background: rgba(169, 189, 203, 0.14);
  color: #d5e1e9;
}

.rank-3 .rank-number {
  border-color: #c98551;
  background: rgba(201, 133, 81, 0.16);
  color: #eab184;
}

.rank-member {
  display: block;
  color: #e8f5fd;
}

.rank-member + small {
  display: block;
  margin-top: 3px;
  color: #708ba0;
  font-size: 9px;
  font-weight: 700;
}

.rank-1 .rank-member + small {
  color: #d9a938;
}

.rank-2 .rank-member + small {
  color: #99afbe;
}

.rank-3 .rank-member + small {
  color: #bd7f50;
}

.rank-uv {
  color: #f0f8ff;
  font-size: 15px;
}

.member-metric-cell {
  min-width: 56px;
}

.member-metric-cell > strong {
  display: block;
  color: #e9f5fd;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.member-metric-change {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.member-metric-change.up {
  color: #55dda9;
}

.member-metric-change.down {
  color: #ff818b;
}

.member-metric-change.flat {
  color: #9eb4c4;
}

.summary-metric-cell {
  min-width: 54px;
}

.summary-metric-cell > strong {
  display: block;
  color: #e9f5fd;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.summary-metric-change {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.summary-metric-change.up {
  color: #55dda9;
}

.summary-metric-change.down {
  color: #ff818b;
}

.summary-metric-change.flat {
  color: #9eb4c4;
}

.rank-trend {
  display: inline-flex;
  min-width: 58px;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.rank-trend.up {
  background: rgba(42, 201, 143, 0.14);
  color: #55dda9;
}

.rank-trend.down {
  background: rgba(240, 95, 107, 0.14);
  color: #ff818b;
}

.rank-trend.flat {
  background: rgba(105, 131, 152, 0.15);
  color: #9eb4c4;
}

.account-request-panel {
  margin-bottom: 16px;
}

.account-request-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 220px) 120px;
  align-items: end;
  gap: 12px;
}

.account-request-history {
  margin-top: 16px;
}

.account-request-history h3 {
  margin-bottom: 10px;
}

.account-requests-table {
  min-width: 1060px;
}

.account-requests-table .row-actions {
  flex-wrap: nowrap;
}

.account-request-details {
  min-width: 130px;
}

.account-request-details summary {
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}

.account-request-detail-list {
  display: grid;
  gap: 5px;
  min-width: 220px;
  margin-top: 8px;
  color: var(--muted);
}

.account-request-detail-list a {
  color: var(--accent);
  font-weight: 700;
}

.account-request-detail-list small {
  color: #f7bd73;
}

.vault-metrics {
  margin-bottom: 16px;
}

.vault-distribution-panel {
  margin-bottom: 16px;
}

.vault-distribution-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.vault-distribution-item {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.vault-distribution-platform {
  height: 22px;
}

.vault-distribution-item > strong {
  display: block;
  margin-top: 6px;
  color: #f1f8ff;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.vault-distribution-item > small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.vault-distribution-stats {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.vault-distribution-stats b {
  margin-left: 2px;
  color: #ddecf8;
  font-variant-numeric: tabular-nums;
}

.vault-requests-panel,
.vault-import-panel,
.vault-list-panel {
  margin-top: 16px;
}

.vault-import-grid {
  display: grid;
  grid-template-columns: 150px 170px 190px minmax(0, 1fr) 130px;
  align-items: end;
  gap: 12px;
}

.vault-raw-field textarea {
  min-height: 126px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.vault-import-button {
  height: 38px;
}

.vault-format-help {
  display: block;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
}

.vault-format-help > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
}

.vault-format-help > summary::-webkit-details-marker {
  display: none;
}

.vault-format-help > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--brand);
  font-size: 16px;
}

.vault-format-help[open] > summary {
  border-bottom: 1px solid var(--line);
}

.vault-format-help[open] > summary::after {
  content: "-";
}

.vault-format-help > summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.vault-format-help > summary span {
  color: var(--muted);
}

.vault-format-grid {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 8px 12px;
  padding: 12px;
}

.vault-format-help strong {
  color: var(--text);
}

.vault-format-help code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #91b2c7;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 700px) {
  .vault-format-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .vault-format-grid strong:not(:first-child) {
    margin-top: 8px;
  }
}

.vault-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(180px, 1.4fr) repeat(2, minmax(140px, 1fr)) 110px;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.vault-bulk-assign {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(190px, 1fr) minmax(190px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.vault-selection-count {
  align-self: center;
  color: var(--muted);
}

.vault-selection-count b {
  margin-inline: 4px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.account-vault-table {
  min-width: 1380px;
}

.vault-credential-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 190px;
}

.vault-credential-tags .tag {
  min-height: 20px;
  padding: 2px 6px;
}

@media (max-width: 1450px) {
  .vault-import-grid {
    grid-template-columns: 140px 155px 170px minmax(0, 1fr) 120px;
  }
}

@media (max-width: 980px) {
  .vault-import-grid,
  .vault-filter-grid,
  .vault-bulk-assign {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vault-raw-field {
    grid-column: 1 / -1;
  }
}
.post-refresh-dialog { width: 740px; max-width: calc(100vw - 48px); max-height: 88vh; overflow: auto; padding: 24px; border: 1px solid var(--border, #1d475e); border-radius: 8px; background: #091b29; color: #dce9f1; }
.post-refresh-dialog::backdrop { background: rgba(0, 0, 0, .65); }
.post-refresh-dialog h2 { margin: 0; font-size: 18px; }
.post-refresh-dialog .panel-head { margin-bottom: 18px; }
.post-refresh-scope { display: flex; flex-direction: column; gap: 8px; border-block: 1px solid #1d475e; padding: 14px 0; margin-bottom: 18px; overflow-wrap: anywhere; }
.post-refresh-scope span, .post-refresh-count span { color: #8daabc; font-size: 12px; }
.post-refresh-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-refresh-fields label { display: flex; flex-direction: column; gap: 6px; }
.post-refresh-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.post-refresh-preview:not(:empty) { border-top: 1px solid #1d475e; padding-top: 16px; margin-top: 20px; }
.post-refresh-count { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.post-refresh-sample { width: 100%; table-layout: fixed; }
.post-refresh-sample th:first-child { width: 65%; }
.post-refresh-sample td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-refresh-error, .post-refresh-errors { color: #f49ca6; font-size: 13px; }
.post-refresh-error:empty { display: none; }
.post-refresh-progress { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 0 0 14px; font-size: 13px; }
.post-refresh-progress span { color: #8daabc; }
.post-refresh-progress progress { width: 180px; height: 8px; accent-color: #26bdcc; }
.post-refresh-errors { padding-bottom: 12px; }
