


:root {
  color-scheme: light;

  --ds-bg:       #fafafa;   
  --ds-surface:  #ffffff;   
  --ds-ink:      #0a0a0a;   
  --ds-ink2:     #171717;   
  --ds-muted:    #737373;   
  --ds-muted2:   #a3a3a3;   
  --ds-line:     #e5e5e5;   
  --ds-line2:    #f0f0f0;   
  --ds-accent:   #0a0a0a;   
  --ds-ok:       #16a34a;
  --ds-ok-soft:  #15803d;   
  --ds-bad:      #dc2626;
  --ds-warn:     #ca8a04;
  --ds-ok-bg:    #f0fdf4;
  --ds-bad-bg:   #fef2f2;
  --ds-warn-bg:  #fefce8;

  --ds-sidebar-w:            220px;
  --ds-sidebar-w-collapsed:   56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }


body {
  height: 100%;
  background: var(--ds-bg);
  font-family: 'Geist', 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  color: var(--ds-ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}


.ds-shell { height: 100%; display: flex; }

.ds-sidebar {
  flex: 0 0 auto;
  width: var(--ds-sidebar-w);
  transition: width 180ms ease;
  display: flex; flex-direction: column; gap: 14px;
  padding: 10px 10px 12px;
  background: var(--ds-surface);
  border-right: 1px solid var(--ds-line);
  overflow: hidden;                 
  position: relative; z-index: 20;  
}

body.ds-sidebar-collapsed .ds-sidebar { width: var(--ds-sidebar-w-collapsed); }
@media (max-width: 900px) { .ds-sidebar { width: var(--ds-sidebar-w-collapsed); } }


.ds-side-label { white-space: nowrap; }
body.ds-sidebar-collapsed .ds-side-label { display: none; }

.ds-side-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px 6px; }
body.ds-sidebar-collapsed .ds-side-head { flex-direction: column; align-items: center; gap: 6px; padding: 2px 0; }
.ds-side-head .ds-brand { flex: 1; min-width: 0; }
body.ds-sidebar-collapsed .ds-side-head .ds-brand { flex: 0 0 auto; }

.ds-side-toggle {
  width: 26px; height: 26px; flex-shrink: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ds-line); border-radius: 6px;
  background: transparent; color: var(--ds-muted); cursor: pointer;
  transition: background 100ms, color 100ms;
}
.ds-side-toggle:hover { background: var(--ds-line2); color: var(--ds-ink); }
.ds-side-toggle svg { transition: transform 180ms ease; }
body.ds-sidebar-collapsed .ds-side-toggle svg { transform: rotate(180deg); }

.ds-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.ds-brand-icon {
  width: 22px; height: 22px; border-radius: 5px;
  background: var(--ds-ink); color: #fff;
  display: grid; place-items: center;
  font-family: 'Geist Mono', monospace; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.ds-brand-name { font-weight: 600; font-size: 14px; color: var(--ds-ink); letter-spacing: -0.2px; }

.ds-nav { display: flex; flex-direction: column; gap: 2px; }
.ds-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; font-size: 13px; color: var(--ds-muted);
  text-decoration: none; border-radius: 6px; background: transparent;
  white-space: nowrap; overflow: hidden;
  transition: background 100ms, color 100ms;
}
.ds-nav-item svg { flex-shrink: 0; }
body.ds-sidebar-collapsed .ds-nav-item { justify-content: center; padding: 7px 0; }
.ds-nav-item:hover  { background: var(--ds-line2); color: var(--ds-ink); }
.ds-nav-item.active { background: var(--ds-line2); color: var(--ds-ink); font-weight: 500; }
.ds-nav-item.disabled { pointer-events: none; opacity: 0.5; }


.ds-side-foot { display: flex; flex-direction: column; gap: 8px; }
.ds-acct { position: relative; }

.ds-acct-btn {
  display: flex; align-items: center; gap: 8px;
  margin: -3px -4px; padding: 3px 4px; width: calc(100% + 8px);  
  border: none; border-radius: 6px; background: transparent;
  font-family: inherit; text-align: left; color: inherit; cursor: pointer;
  transition: background 100ms;
}
.ds-acct-btn:hover, .ds-acct-btn.is-open { background: var(--ds-line2); }
body.ds-sidebar-collapsed .ds-acct-btn { justify-content: center; margin: 0; padding: 3px 0; width: 100%; }
.ds-acct-btn-name { flex: 1; min-width: 0; font-size: 11.5px; color: var(--ds-muted); overflow: hidden; text-overflow: ellipsis; }
.ds-acct-btn-chevron { color: var(--ds-muted2); flex-shrink: 0; }


.ds-acct-menu {
  position: fixed; left: 8px; bottom: 47px; z-index: 26;
  width: 246px; max-width: calc(100vw - 16px);
  display: flex; flex-direction: column; gap: 1px; padding: 6px;
  background: var(--ds-surface); border: 1px solid var(--ds-line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.20);
}
.ds-acct-head {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 10px; margin-bottom: 5px; border-bottom: 1px solid var(--ds-line);
}
.ds-acct-head-id   { min-width: 0; }
.ds-acct-head-name { font-size: 12.5px; font-weight: 600; color: var(--ds-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-acct-head-mail { font-family: 'Geist Mono', monospace; font-size: 10.5px; color: var(--ds-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }

.ds-acct-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px; border: none; border-radius: 6px; background: transparent;
  font-family: inherit; font-size: 12.5px; text-align: left; text-decoration: none;
  color: var(--ds-ink2); cursor: pointer; transition: background 100ms, color 100ms;
}
.ds-acct-item:hover { background: var(--ds-line2); color: var(--ds-ink); }
.ds-acct-item svg, .ds-acct-item img { flex-shrink: 0; }
.ds-acct-item img { border-radius: 2px; display: block; }
.ds-acct-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ds-acct-item-value { flex-shrink: 0; font-size: 11.5px; color: var(--ds-muted); }
.ds-acct-item-chevron { color: var(--ds-muted2); transition: transform 150ms ease; }
.ds-acct-item-chevron.is-open { transform: rotate(90deg); }


.ds-acct-flyout { position: relative; }
.ds-acct-submenu {
  position: absolute; left: calc(100% + 11px); top: -7px; z-index: 1;
  display: none; flex-direction: column; gap: 1px; padding: 6px; min-width: 176px;
  background: var(--ds-surface); border: 1px solid var(--ds-line);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.20);
}

.ds-acct-submenu::before { content: ""; position: absolute; top: 0; bottom: 0; left: -13px; width: 13px; }
.ds-acct-flyout:hover > .ds-acct-submenu,
.ds-acct-flyout.is-open > .ds-acct-submenu { display: flex; }
.ds-acct-flyout:hover > .ds-acct-item,
.ds-acct-flyout.is-open > .ds-acct-item { background: var(--ds-line2); color: var(--ds-ink); }
.ds-acct-item.is-on { color: var(--ds-ink); font-weight: 500; }
.ds-acct-sep { height: 1px; background: var(--ds-line); margin: 5px 0; }

.ds-acct-item--danger:hover { background: var(--ds-bad-bg); color: var(--ds-bad); }
.ds-acct-version {
  margin: 5px -6px -6px; padding: 7px 14px 5px; border-top: 1px solid var(--ds-line);
  font-family: 'Geist Mono', monospace; font-size: 10px; color: var(--ds-muted2);
  user-select: none; cursor: default;
}


.ds-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ds-ink2); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; line-height: 1; flex-shrink: 0; user-select: none;
}
.ds-avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.ds-avatar-md { width: 32px; height: 32px; font-size: 12px; }


.ds-avatar-add {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px dashed var(--ds-line);
  background: none; cursor: pointer; color: var(--ds-muted);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; padding: 0;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.ds-avatar-add:hover:not(:disabled) { border-color: var(--ds-ink2); color: var(--ds-ink2); background: var(--ds-line2); }
.ds-avatar-btn { background: none; border: none; padding: 0; cursor: pointer; line-height: 0; }
.ds-avatar-btn:disabled, .ds-avatar-add:disabled { cursor: default; opacity: .6; }


.ds-owner-pop {
  position: absolute; z-index: 30; width: 304px; max-width: 90vw;
  background: var(--ds-surface); border: 1px solid var(--ds-line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); overflow: hidden;
}
.ds-owner-pop-head  { display: flex; align-items: center; padding: 8px 8px 8px 36px; border-bottom: 1px solid var(--ds-line); }
.ds-owner-pop-title { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--ds-ink2); }
.ds-owner-pop-close {
  width: 28px; height: 28px; border: none; background: none; border-radius: 6px;
  cursor: pointer; color: var(--ds-muted); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ds-owner-pop-close:hover { background: var(--ds-line2); color: var(--ds-ink2); }
.ds-owner-pop-body  { padding: 10px 12px 12px; }
.ds-owner-pop-label { font-size: 10.5px; font-weight: 600; color: var(--ds-muted); text-transform: uppercase; letter-spacing: .6px; margin: 10px 0 6px; }
.ds-owner-option {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: none; border-radius: 6px; padding: 6px 8px;
  cursor: pointer; font-size: 12.5px; color: var(--ds-ink);
}
.ds-owner-option:hover:not(:disabled) { background: var(--ds-line2); }
.ds-owner-option:disabled { cursor: default; opacity: .6; }


.ds-filter { position: relative; z-index: 26; }   
.ds-filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 9px; max-width: 260px;
  background: var(--ds-bg); border: 1px solid var(--ds-line); border-radius: 6px;
  font-family: inherit; font-size: 12px; color: var(--ds-ink); cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.ds-filter-btn:hover { border-color: var(--ds-ink2); }
.ds-filter-btn-label { color: var(--ds-muted); white-space: nowrap; }
.ds-filter-btn-value { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ds-filter-btn-count {
  min-width: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--ds-accent); color: #fff; flex-shrink: 0;
  font-family: 'Geist Mono', monospace; font-size: 10px; line-height: 16px; text-align: center;
}
.ds-filter-btn-chevron { color: var(--ds-muted); flex-shrink: 0; margin-left: auto; }
.ds-filter-add { width: 18px; height: 18px; margin-left: auto; border-width: 1.2px; }
.ds-filter-btn:hover .ds-filter-add { border-color: var(--ds-ink2); color: var(--ds-ink2); }
.ds-filter-btn.is-active { border-color: var(--ds-accent); background: var(--ds-surface); }
.ds-filter-btn.is-active .ds-filter-btn-label::after { content: ":"; }
.ds-filter-pop { left: 0; top: calc(100% + 6px); }
.ds-filter-options { max-height: 340px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.ds-filter-option-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ds-filter-option-trailing {
  flex-shrink: 0; white-space: nowrap; color: var(--ds-muted); font-size: 11.5px;
  display: inline-flex; align-items: center; gap: 6px;
}

.ds-filter-option-check { margin-left: auto; flex-shrink: 0; color: var(--ds-ink2); visibility: hidden; }
.ds-filter-option-check.is-on { visibility: visible; }
.ds-filter-dot {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1px solid transparent; box-sizing: border-box;
  flex-shrink: 0; margin-left: 3px; margin-right: 2px;
}

.ds-filter-wide .ds-filter-pop { width: 520px; }
.ds-filter-wide .ds-filter-option-label { white-space: normal; overflow: visible; text-overflow: clip; }
.ds-filter-wide .ds-owner-option { align-items: flex-start; }
.ds-filter-wide .ds-filter-btn { max-width: 320px; }
.ds-filter-clear {
  width: 100%; margin-top: 8px; padding: 6px 8px;
  background: none; border: 1px solid var(--ds-line); border-radius: 6px;
  font-family: inherit; font-size: 12px; color: var(--ds-muted); cursor: pointer;
}
.ds-filter-clear:hover { border-color: var(--ds-ink2); color: var(--ds-ink); }

.ds-filter-backdrop { position: fixed; inset: 0; z-index: 25; background: none; }


main { flex: 1 1 auto; min-width: 0; height: 100%; display: flex; flex-direction: column; }
.ds-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }


.ds-subheader {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--ds-line);
  background: var(--ds-surface);
  position: relative; z-index: 10; flex-shrink: 0;
}
.ds-subheader-title { font-size: 14px; font-weight: 600; }
.ds-subheader-meta  { font-size: 11.5px; color: var(--ds-muted); font-family: 'Geist Mono', monospace; margin-top: 2px; }
.ds-spacer { flex: 1; }


.ds-count { font-variant-numeric: tabular-nums; }

.ds-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 380px; margin: 0 16px;
  border: 1px solid var(--ds-line); border-radius: 6px;
  padding: 5px 10px; background: var(--ds-bg);
}
.ds-search input { flex: 1; border: none; outline: none; background: transparent; font-size: 12.5px; color: var(--ds-ink); font-family: inherit; }
.ds-search kbd {
  font-size: 10px; color: var(--ds-muted); font-family: 'Geist Mono', monospace;
  background: var(--ds-surface); padding: 1px 5px; border: 1px solid var(--ds-line); border-radius: 3px;
}

.ds-stats { display: flex; align-items: center; gap: 10px; }
.ds-progress { width: 72px; height: 4px; background: var(--ds-line2); border-radius: 2px; overflow: hidden; }
.ds-progress-fill { height: 100%; background: var(--ds-accent); border-radius: 2px; transition: width 400ms ease; }
.ds-stat-ok  { color: var(--ds-ok);  font-weight: 600; font-family: 'Geist Mono', monospace; }
.ds-stat-bad { color: var(--ds-bad); font-weight: 600; font-family: 'Geist Mono', monospace; }
.ds-divider  { width: 1px; height: 16px; background: var(--ds-line); }


.ds-content { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; overflow: auto; min-height: 0; }


.ds-progress-card { padding: 18px 20px; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.ds-spinner { width: 16px; height: 16px; border: 2px solid var(--ds-line2); border-top-color: var(--ds-ink); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }


.ds-input-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 16px; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 8px; font-size: 12.5px; }
.ds-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.ds-dot-ok { background: var(--ds-ok); }
.ds-mono { font-family: 'Geist Mono', monospace; }
.ds-input-panel { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 8px; padding: 18px; }
.ds-input-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ds-input-label { font-size: 13px; font-weight: 600; }
.ds-input-hint  { font-size: 12px; color: var(--ds-muted); margin-top: 2px; }
.ds-textarea {
  width: 100%; resize: vertical; padding: 12px;
  font-family: 'Geist Mono', monospace; font-size: 12.5px; line-height: 1.6;
  color: var(--ds-ink); background: var(--ds-bg);
  border: 1px solid var(--ds-line); border-radius: 6px; outline: none;
}
.ds-textarea:focus { border-color: var(--ds-ink); }


.ds-tabs { display: flex; gap: 2px; margin-bottom: 14px; border-bottom: 1px solid var(--ds-line); padding-bottom: 0; }
.ds-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 12.5px; font-weight: 500;
  color: var(--ds-muted); background: transparent; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  cursor: pointer; font-family: inherit; transition: color 100ms;
}
.ds-tab:hover { color: var(--ds-ink2); }
.ds-tab--active { color: var(--ds-ink); border-bottom-color: var(--ds-ink); }
.ds-tab-body { padding: 2px 0 4px; }


.ds-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; font-size: 12px; font-weight: 500;
  color: var(--ds-ink2); background: var(--ds-surface);
  border: 1px solid var(--ds-line); border-radius: 6px;
  cursor: pointer; font-family: inherit;
  transition: background 100ms, border-color 100ms; white-space: nowrap;
}
.ds-btn:hover { background: var(--ds-line2); }
.ds-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ds-btn-primary { color: #fff; background: var(--ds-ink); border-color: var(--ds-ink); }
.ds-btn-primary:hover { background: #262626; border-color: #262626; }


.ds-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ds-chips-label { font-size: 11px; color: var(--ds-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-right: 4px; }
.ds-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 12px; font-weight: 500;
  color: var(--ds-muted); background: transparent;
  border: 1px solid var(--ds-line); border-radius: 999px;
  cursor: pointer; font-family: inherit; transition: all 100ms;
}
.ds-chip--on { color: var(--ds-ink); background: var(--ds-surface); border-color: var(--ds-ink); }
.ds-chip-count { font-family: 'Geist Mono', monospace; font-size: 10.5px; color: var(--ds-muted); }


.ds-table-info {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--ds-line);
  font-size: 12.5px; color: var(--ds-muted);
}
.ds-table-info strong { color: var(--ds-ink); }

.ds-table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.ds-table th {
  text-align: left; padding: 8px 10px;
  font-size: 10.5px; font-weight: 500; color: var(--ds-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  background: var(--ds-bg); border-bottom: 1px solid var(--ds-line); white-space: nowrap;
}
.ds-table td { padding: 6px 10px; border-bottom: 1px solid var(--ds-line2); vertical-align: middle; }


.ds-sort-header {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
}
.ds-sort-header:hover { color: var(--ds-ink2); }
.ds-table th[style*="right"] .ds-sort-header { justify-content: flex-end; width: 100%; }

.ds-row { cursor: pointer; transition: background 80ms; }
.ds-row:hover td { background: #f7f7f7; }

.ds-row--open td, .ds-row:focus td { background: var(--ds-bg); }
.ds-row--open td:first-child, .ds-row:focus td:first-child { box-shadow: inset 3px 0 0 var(--ds-accent); }
.ds-row:focus { outline: none; }

.ds-row--bad  td:first-child { box-shadow: inset 2px 0 0 var(--ds-bad); }
.ds-row--warn td:first-child { box-shadow: inset 2px 0 0 var(--ds-warn); }


.ds-cell-img { width: 72px; padding: 4px 8px !important; }
.ds-product-img { width: 60px; height: 40px; object-fit: contain; border-radius: 4px; border: 1px solid var(--ds-line); background: #fff; display: block; }
.ds-product-img-ph { width: 60px; height: 40px; border-radius: 4px; border: 1px solid var(--ds-line); background: var(--ds-line2); display: flex; align-items: center; justify-content: center; color: var(--ds-muted2); }

.ds-mono-cell    { font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--ds-ink2); letter-spacing: 0.2px; }
.ds-name-primary { font-weight: 500; color: var(--ds-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-name-desc    { font-size: 11px; color: var(--ds-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


.ds-conf { display: inline-flex; align-items: center; gap: 8px; }
.ds-conf-pct { font-family: 'Geist Mono', monospace; font-size: 12px; font-weight: 500; min-width: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.ds-conf-track { position: relative; width: 48px; height: 4px; background: var(--ds-line2); border-radius: 2px; }
.ds-conf-fill  { position: absolute; inset: 0; border-radius: 2px; }

.ds-tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; font-size: 11px; font-weight: 500;
  color: var(--ds-ink2); background: var(--ds-line2);
  border: 1px solid var(--ds-line); border-radius: 999px; white-space: nowrap;
}


.ds-status-seg { display: inline-flex; border: 1px solid var(--ds-line); border-radius: 6px; overflow: hidden; background: var(--ds-surface); }
.ds-status-btn {
  width: 32px; height: 26px; border: none; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; background: var(--ds-surface); color: var(--ds-muted2);
  transition: background 100ms, color 100ms;
}
.ds-status-btn + .ds-status-btn { border-left: 1px solid var(--ds-line); }
.ds-status-btn--ok  { background: var(--ds-ok-bg);  color: var(--ds-ok); }
.ds-status-btn--bad { background: var(--ds-bad-bg); color: var(--ds-bad); }
.ds-status-btn--def { background: var(--ds-line2);  color: var(--ds-muted); }


.ds-pagesize { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ds-pagesize-label { font-size: 11px; color: var(--ds-muted); white-space: nowrap; }
.ds-pagesize-opt {
  font-family: 'Geist Mono', monospace; font-size: 11px; line-height: 1;
  padding: 4px 8px; cursor: pointer; color: var(--ds-muted); background: var(--ds-surface);
  border: 1px solid var(--ds-line); border-radius: 4px;
}
.ds-pagesize-opt:hover:not(:disabled) { color: var(--ds-ink); border-color: var(--ds-ink2); }
.ds-pagesize-opt:disabled { cursor: wait; opacity: .6; }
.ds-pagesize-opt--on { color: var(--ds-ink); border-color: var(--ds-ink); font-weight: 600; }


.ds-loadmore { display: flex; flex-direction: column; align-items: center; padding: 14px 16px 18px; gap: 2px; }
.ds-loadmore-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; padding: 7px 16px; cursor: pointer;
  color: var(--ds-ink2); background: var(--ds-surface);
  border: 1px solid var(--ds-line); border-radius: 6px;
}
.ds-loadmore-btn:hover:not(:disabled) { color: var(--ds-ink); border-color: var(--ds-ink2); }
.ds-loadmore-btn:disabled { cursor: wait; color: var(--ds-muted); }

.ds-loadmore-sentinel { height: 1px; width: 100%; }


.ds-drawer { background: var(--ds-surface); border-left: 1px solid var(--ds-line); display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.ds-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--ds-line);
  background: var(--ds-surface); position: sticky; top: 0; z-index: 1; flex-shrink: 0;
}
.ds-drawer-label { font-size: 10.5px; color: var(--ds-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.ds-drawer-title { font-size: 14px; font-weight: 600; color: var(--ds-ink); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-drawer-body  { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.ds-drawer-hint  { display: flex; justify-content: space-between; align-items: center; padding: 12px; border: 1px dashed var(--ds-line); border-radius: 6px; font-size: 11.5px; color: var(--ds-muted); }

.ds-maxbar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 14px; z-index: 5;
  border: none; border-right: 1px solid var(--ds-line2); background: var(--ds-bg);
  color: var(--ds-muted); cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.ds-maxbar:hover { background: var(--ds-line2); color: var(--ds-ink); }


.ds-cmp { padding: 14px 0 14px 20px; }
.ds-cmp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: 20px; margin-bottom: 10px; }
.ds-cmp-count { font-size: 11px; color: var(--ds-muted); text-transform: uppercase; letter-spacing: .6px; }
.ds-cmp-scroll { overflow-x: auto; padding-right: 20px; }

.ds-cmp-grid { display: grid; min-width: min-content; border: 1px solid var(--ds-line); background: var(--ds-surface); }
.ds-cmp-cell { padding: 8px 10px; font-size: 12px; color: var(--ds-ink2); line-height: 1.45; border-bottom: 1px solid var(--ds-line2); border-left: 1px solid var(--ds-line2); min-width: 0; overflow-wrap: anywhere; }
.ds-cmp-lbl  { position: sticky; left: 0; z-index: 2; border-left: none; background: var(--ds-bg); font-size: 11px; color: var(--ds-muted); }
.ds-cmp-head { background: var(--ds-bg); border-bottom: 1px solid var(--ds-line); }
.ds-cmp-cell.is-diff   { background: var(--ds-warn-bg); }   
.ds-cmp-cell.is-chosen { background: var(--ds-ok-bg); }     
.ds-cmp-head.is-chosen { border-bottom: 2px solid var(--ds-ok-soft); }


.ds-modal-backdrop {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; overflow: hidden;
}
.ds-modal {
  background: var(--ds-surface); border: 1px solid var(--ds-line);
  border-radius: 10px; width: 480px; max-width: calc(100% - 32px);
  box-shadow: 0 24px 64px rgba(0,0,0,.3);
  display: flex; flex-direction: column; max-height: 90vh; overflow-y: auto;
  transition: width .25s ease;   
}
.ds-modal--wide { width: 620px; }
.ds-modal--xl   { width: 1080px; }
.ds-modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--ds-line); }
.ds-modal-body   { padding: 18px 20px; display: flex; flex-direction: column; gap: 0; }
.ds-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--ds-line); }


.ds-toast { max-width: min(460px, calc(100vw - 32px)); box-sizing: border-box; }
.ds-toast, .ds-toast * { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
[style*="--ds-notification-countdown"] { position: relative !important; overflow: hidden !important; }
[style*="--ds-notification-countdown"]::after {
  content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; height: 3px;
  background: rgba(0, 0, 0, .42); transform-origin: left center;
  animation: ds-notification-countdown var(--ds-notification-countdown) linear forwards;
}
@keyframes ds-notification-countdown { from { transform: scaleX(0); } to { transform: scaleX(1); } }


.ds-rc { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(10,10,10,.32); }
.ds-rc[data-ds-rc="down"], .ds-rc[data-ds-rc="failed"], .ds-rc[data-ds-rc="rejected"] { display: flex; }
.ds-rc-card { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 460px; padding: 16px 18px; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 10px; box-shadow: 0 20px 48px rgba(0,0,0,.22); }
.ds-rc-spinner { width: 20px; height: 20px; border-width: 2.5px; }
.ds-rc-text  { flex: 1; min-width: 0; }
.ds-rc-title { font-size: 13px; font-weight: 600; color: var(--ds-ink); }
.ds-rc-note  { font-size: 11.5px; color: var(--ds-muted); margin-top: 2px; line-height: 1.45; }
.ds-rc-actions { display: none; flex-direction: column; gap: 6px; flex-shrink: 0; }
.ds-rc.ds-rc-slow .ds-rc-actions { display: flex; }
.ds-rc[data-ds-rc="failed"] .ds-rc-spinner { display: none; }   


.ds-error-boundary { max-width: 560px; margin: 48px auto; padding: 24px; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 8px; text-align: center; }
.ds-error-boundary h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--ds-ink); }
.ds-error-boundary p  { margin: 0 0 16px; font-size: 13px; line-height: 1.5; color: var(--ds-muted); }


.ds-pill { display: inline-flex; align-items: center; padding: 1px 7px; font-size: 10.5px; font-weight: 500; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.ds-pill--ok    { background: var(--ds-ok-bg);   color: var(--ds-ok-soft); border-color: var(--ds-ok); }
.ds-pill--bad   { background: var(--ds-bad-bg);  color: var(--ds-bad);     border-color: var(--ds-bad); }
.ds-pill--warn  { background: var(--ds-warn-bg); color: var(--ds-warn);    border-color: var(--ds-warn); }
.ds-pill--muted { background: var(--ds-line2);   color: var(--ds-muted);   border-color: var(--ds-line); }


.ds-stat-tile { text-align: left; cursor: pointer; font-family: inherit; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 8px; padding: 14px 16px; transition: border-color .12s; }
.ds-stat-tile:hover { border-color: var(--ds-muted2); }

.ds-stat-tile--static { cursor: default; }
.ds-stat-tile--static:hover { border-color: var(--ds-line); }
.ds-stat-label { font-size: 11px; color: var(--ds-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.ds-stat-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.ds-stat-note  { font-size: 11.5px; color: var(--ds-muted); margin-top: 3px; }
.ds-stat-row   { display: grid; gap: 14px; margin-bottom: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.ds-empty-cell { padding: 24px; text-align: center; color: var(--ds-muted); font-size: 12.5px; }
.ds-link { color: var(--ds-ink2); text-decoration: none; border-bottom: 1px solid var(--ds-line); }
.ds-link:hover { color: var(--ds-ink); border-bottom-color: var(--ds-muted); }


.ds-pre {
  margin: 4px 0 0; padding: 8px 10px; max-height: 220px; overflow: auto;
  background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 6px;
  font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; color: var(--ds-ink2);
}
.ds-pre--tall { max-height: 340px; }


.ds-truncate { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-nowrap   { white-space: nowrap; }
.ds-num      { font-variant-numeric: tabular-nums; }
.ds-muted    { color: var(--ds-muted); }


@keyframes ds-blink {
  0%, 100% { border-color: var(--ds-line2); background: var(--ds-surface); }
  25%, 75% { border-color: #f59e0b;         background: #fffbeb;           }
}
.ds-blink { animation: ds-blink 0.55s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) {
  .ds-blink { animation: none; border-color: #f59e0b; background: #fffbeb; }
}
