/* ===================================================================
   District Seal — Dashboard (Rubick-inspired, light-first)
   =================================================================== */

:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --sidebar-bg: #ffffff;
  --text: #1a2232;
  --text-muted: #6b7285;
  --text-dim: #8b93a7;
  --text-faint: #b0b6c2;
  --border: #e8ecf3;
  --border-2: #d9dfea;
  --gold: #c8102e;
  --gold-hover: #a50d25;
  --gold-soft: rgba(200,16,46,.06);
  --blue: #4361ee;
  --ok: #22b573;
  
  --fail: #e5484d;
  --fail-soft: #fdecec;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --shadow-sm: 0 1px 2px rgba(20,30,60,.04);
  --shadow-md: 0 4px 12px rgba(20,30,60,.05);
  --shadow-lg: 0 12px 40px rgba(20,30,60,.08);
}

body.ds-app.theme-dark {
  --bg: #0b0d14;
  --card: #121723;
  --sidebar-bg: #0e121c;
  --text: #e6e8ef;
  --text-muted: #8b93a7;
  --text-dim: #6b7285;
  --text-faint: #4a5162;
  --border: rgba(255,255,255,.06);
  --border-2: rgba(255,255,255,.1);
  --gold: #c8102e;
  --gold-hover: #a50d25;
  --gold-soft: rgba(200,16,46,.08);
  
  --fail-soft: rgba(229,72,77,.1);
  --amber-soft: rgba(245,158,11,.1);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }

body.ds-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}

/* ============== Sidebar ============== */
.ds-side {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 20px 14px 16px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.ds-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px 8px;
  text-decoration: none;
  margin-bottom: 8px;
}
.ds-logo-seal {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}
.ds-logo-text {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.ds-side-section {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  padding: 16px 12px 6px 12px;
}
#side-nav, #side-nav-2, #side-nav-3 { display: flex; flex-direction: column; gap: 2px; }
#side-nav a, #side-nav-2 a, #side-nav-3 a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
#side-nav a:hover, #side-nav-2 a:hover, #side-nav-3 a:hover {
  background: var(--bg);
  color: var(--text);
}
#side-nav a.active, #side-nav-2 a.active, #side-nav-3 a.active {
  background: var(--gold-soft);
  color: var(--gold);
}
#side-nav a svg, #side-nav-2 a svg, #side-nav-3 a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.9;
}
.ds-badge {
  margin-left: auto;
  background: var(--fail-soft);
  color: var(--fail);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  min-width: 20px;
  text-align: center;
}
.ds-badge:empty { display: none; }

.ds-side-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.ds-me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 3px;
  cursor: pointer;
  transition: background .1s ease;
}
.ds-me:hover { background: var(--bg); }
.ds-avatar {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.ds-me-text {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  min-width: 0;
  flex: 1;
}
.ds-me-text strong {
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ds-me-text span {
  color: var(--text-dim);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ds-me svg { width: 13px; height: 13px; color: var(--text-faint); }

/* ============== Topbar ============== */
.ds-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}
.ds-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 14px;
}
.ds-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}
.ds-breadcrumb strong { color: var(--text); font-weight: 600; }
.ds-breadcrumb svg { color: var(--text-faint); }

.ds-topbar-right { display: flex; align-items: center; gap: 10px; }
.ds-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 7px 12px;
  width: 260px;
  transition: border-color .15s ease;
}
.ds-search:focus-within { border-color: var(--gold); }
.ds-search input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 12.5px;
  width: 100%;
  font-family: inherit;
}
.ds-search input::placeholder { color: var(--text-faint); }
.ds-search svg { width: 14px; height: 14px; color: var(--text-faint); flex-shrink: 0; }
.ds-avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 3px;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

/* ============== Content ============== */
.ds-content {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px 60px 28px;
}
.ds-h1 {
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0 0 4px 0;
  line-height: 1.2;
}


/* ============== KPI cards (4 across) ============== */
.ds-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.ds-kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 18px 20px;
  box-shadow: none;
  position: relative;
}
.ds-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ds-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-soft);
  color: var(--gold);
}
.ds-kpi-icon.blue { background: rgba(67,97,238,.1); color: var(--blue); }
.ds-kpi-icon.green { background: var(rgba(74,124,89,.10)); color: var(--ok); }
.ds-kpi-icon.red { background: var(--fail-soft); color: var(--fail); }
.ds-kpi-icon.amber { background: var(--amber-soft); color: var(--amber); }
.ds-kpi-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.ds-kpi-pct {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.ds-kpi-pct.up { background: var(rgba(74,124,89,.10)); color: var(--ok); }
.ds-kpi-pct.down { background: var(--fail-soft); color: var(--fail); }
.ds-kpi-num {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.ds-kpi-label {
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 500;
}

/* ============== Main grid: chart + right panel ============== */
.ds-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  margin-bottom: 22px;
}
.ds-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 20px 22px;
  box-shadow: none;
}
.ds-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ds-card-head h3 {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.ds-card-head a,
.ds-card-head span {
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
}
.ds-card-head a:hover { color: var(--gold); }

/* Chart */
.ds-chart-wrap { position: relative; }
.ds-chart-svg { display: block; width: 100%; height: 200px; }
.ds-chart-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 12px;
  font-size: 12px;
}
.ds-chart-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
}
.ds-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--gold);
}
.ds-legend-dot.dim {
  background: var(--text-faint);
  opacity: 0.6;
}

/* Right list (Transactions on overview) */
.ds-list { display: flex; flex-direction: column; }
.ds-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: padding-left .1s ease;
}
.ds-list-item:hover { padding-left: 3px; }
.ds-list-item:last-child { border-bottom: 0; }
.ds-list-avatar {
  width: 34px;
  height: 34px;
  border-radius: 3px;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.ds-list-body { flex: 1; min-width: 0; }
.ds-list-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ds-list-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.ds-list-right {
  text-align: right;
  flex-shrink: 0;
}

/* ============== Full-width list ============== */
.ds-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 20px 22px;
  box-shadow: none;
  margin-bottom: 16px;
}

/* Activity feed */
.ds-feed { display: flex; flex-direction: column; }
.ds-feed-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.ds-feed-item:last-child { border-bottom: 0; }
.ds-feed-avatar {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
  flex-shrink: 0;
}
.ds-feed-body { flex: 1; min-width: 0; }
.ds-feed-title { font-size: 12.5px; color: var(--text); font-weight: 500; }
.ds-feed-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; line-height: 1.5; word-break: break-word; }
.ds-feed-time { font-size: 11px; color: var(--text-faint); flex-shrink: 0; }

/* Table */
.ds-table { width: 100%; border-collapse: collapse; }
.ds-table th, .ds-table td {
  text-align: left;
  padding: 12px 14px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
.ds-table th {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  background: transparent;
  padding-top: 10px;
  padding-bottom: 10px;
}
.ds-table tr:last-child td { border-bottom: 0; }
.ds-table tbody tr { cursor: pointer; transition: background .1s ease; }
.ds-table tbody tr:hover { background: var(--bg); }
.ds-table .ds-mono {
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 11.5px;
  color: var(--text-muted);
}
.ds-table .ds-muted { color: var(--text-dim); font-size: 11.5px; }
.ds-signer-cell { display: flex; align-items: center; gap: 10px; }
.ds-signer-avatar {
  width: 30px;
  height: 30px;
  border-radius: 3px;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.ds-signer-name { font-weight: 500; color: var(--text); font-size: 12.5px; }
.ds-signer-email { color: var(--text-dim); font-size: 11px; }

/* Pills */
.ds-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ds-pill-verified, .ds-pill-ledger_issued { background: var(rgba(74,124,89,.10)); color: var(--ok); }
.ds-pill-failed { background: var(--fail-soft); color: var(--fail); }
.ds-pill-created,
.ds-pill-webauthn_verified,
.ds-pill-scroll_complete,
.ds-pill-consent_accepted,
.ds-pill-liveness_captured { background: var(--amber-soft); color: var(--amber); }

/* Filters */
.ds-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.ds-filter-pill {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all .1s ease;
}
.ds-filter-pill:hover { color: var(--text); border-color: var(--border-2); }
.ds-filter-pill.active {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: transparent;
}
.ds-filters input {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 3px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  min-width: 220px;
}
.ds-filters input:focus { border-color: var(--gold); }
.ds-filters .ds-count { margin-left: auto; font-size: 12px; color: var(--text-dim); }

/* ============== Forms ============== */

.ds-form h2 {
  margin: 0 0 4px 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--text);
}
.ds-form p.muted {
  color: var(--text-dim);
  font-size: 12.5px;
  margin: 0 0 22px 0;
  max-width: 520px;
  line-height: 1.55;
}
.ds-form label {
  display: block;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px 0;
  font-weight: 500;
}


.ds-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ds-form-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }


/* ============== Drop zones ============== */
.ds-drop {
  border: 1px dashed var(--border-2);
  border-radius: 3px;
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  background: transparent;
  margin-bottom: 14px;
}
.ds-drop:hover, .ds-drop.over {
  border-color: var(--text-muted);
  background: var(--hover);
}
.ds-drop svg {
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  margin-bottom: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}
.ds-drop strong { color: var(--text); font-size: 13.5px; display: block; margin-bottom: 4px; font-weight: 600; }
.ds-drop span { color: var(--text-dim); font-size: 12px; }
.ds-drop input[type="file"] { display: none; }
.ds-drop-filled {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  background: var(rgba(74,124,89,.10));
  border: 1px solid rgba(34,181,115,.25);
  border-radius: 3px;
  margin-bottom: 14px;
  font-size: 12.5px;
}
.ds-drop-filled svg { width: 16px; height: 16px; color: var(--ok); stroke: currentColor; fill: none; stroke-width: 2; }
.ds-drop-filled .name { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-drop-filled button { background: transparent; border: 0; color: var(--text-faint); cursor: pointer; padding: 4px; }
.ds-drop-filled button:hover { color: var(--fail); }

/* ============== Buttons ============== */
.ds-btn {
  appearance: none;
  border: 0;
  background: var(--gold);
  color: #ffffff;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .12s ease;
  font-family: inherit;
}
.ds-btn:hover { background: var(--gold-hover); }
.ds-btn:disabled { opacity: .5; cursor: not-allowed; }
.ds-btn-sm { padding: 6px 12px; font-size: 12px; }
.ds-btn-lg { padding: 12px 22px; font-size: 13.5px; }
.ds-btn-block { width: 100%; }
.ds-btn-ghost {
  background: var(--card);
  border: 1px solid var(--border-2);
  color: var(--text);
}
.ds-btn-ghost:hover { background: var(--bg); }
.ds-btn-danger { background: transparent; border: 1px solid rgba(229,72,77,.35); color: var(--fail); }
.ds-btn-danger:hover { background: var(--fail-soft); }
.ds-icon-btn {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  padding: 7px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .12s ease;
}
.ds-icon-btn:hover { color: var(--text); background: var(--bg); }
.ds-icon-btn svg { width: 16px; height: 16px; }

/* Tabs */
.ds-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.ds-tab {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  transition: all .12s ease;
}
.ds-tab:hover { color: var(--text); }
.ds-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.ds-tab-panel.hidden { display: none; }

/* ============== Drawer ============== */
.ds-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(540px, 94vw);
  background: var(--card);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 200;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}
.ds-drawer.open { transform: translateX(0); }
.ds-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.ds-drawer-head h2 {
  margin: 4px 0 0 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
  font-size: 20px;
  color: var(--text);
}
.ds-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.ds-drawer-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.ds-drawer-body h3 {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 22px 0 10px 0;
  font-weight: 600;
}
.ds-drawer-body h3:first-child { margin-top: 0; }
.ds-kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 9px 12px;
  font-size: 12.5px;
}
.ds-kv > div:nth-child(odd) { color: var(--text-dim); }
.ds-kv > div:nth-child(even) { color: var(--text); word-break: break-word; }
.ds-kv .ds-mono { font-family: ui-monospace, monospace; font-size: 11.5px; }

.ds-timeline { position: relative; padding-left: 20px; }
.ds-timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--border);
}
.ds-tl-item { position: relative; padding: 8px 0; font-size: 12.5px; }
.ds-tl-item::before {
  content: "";
  position: absolute;
  left: -18px; top: 13px;
  width: 7px; height: 7px;
  border-radius: 3px;
  background: var(--ok);
  box-shadow: none;
}
.ds-tl-item.warn::before { background: var(--amber); }
.ds-tl-item.err::before { background: var(--fail); }
.ds-tl-ts { font-family: ui-monospace, monospace; font-size: 10.5px; color: var(--text-faint); margin-bottom: 2px; }
.ds-tl-label { color: var(--text); font-weight: 500; }
.ds-tl-detail { color: var(--text-dim); font-size: 11.5px; margin-top: 3px; word-break: break-word; line-height: 1.5; }

.ds-drawer-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.ds-drawer-foot a, .ds-drawer-foot button { flex: 1; }

/* Toast */
.ds-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ok);
  padding: 12px 18px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--text);
  z-index: 500;
  transform: translateY(20px);
  opacity: 0;
  transition: all .22s ease;
  pointer-events: none;
  
  box-shadow: none;
}
.ds-toast.show { transform: translateY(0); opacity: 1; }
.ds-toast.err { border-left-color: var(--fail); }

/* Empty state */
.ds-empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}
.ds-empty a { color: var(--gold); text-decoration: none; }

/* Skeleton */
.ds-skeleton {
  background: transparent, var(--bg), var(--border));
  background-size: 200% 100%;
  animation: dsShimmer 1.4s infinite;
  border-radius: 3px;
}
@keyframes dsShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Upload progress */
.ds-progress-track {
  width: 100%;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 16px 0 8px 0;
}
.ds-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  border-radius: 3px;
  transition: width .15s ease;
}
.ds-progress-label { font-size: 12px; color: var(--text-dim); text-align: center; }

/* Success */
.ds-success { text-align: center; padding: 50px 20px;  margin: 0 auto; }
.ds-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 3px;
  background: var(rgba(74,124,89,.10));
  color: var(--ok);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}
.ds-success-icon svg { width: 32px; height: 32px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.ds-success h2 {
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
  font-size: 26px;
  margin: 0 0 10px 0;
  color: var(--text);
}
.ds-success p { color: var(--text-dim); font-size: 13.5px; line-height: 1.6; margin: 0 0 24px 0; }
.ds-success-link {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 12px 15px;
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  word-break: break-all;
  margin-bottom: 14px;
  text-align: left;
}
.ds-success-actions { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }

/* Language select */
.ds-lang-select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 9px;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  outline: none;
}
.ds-lang-select:focus { border-color: var(--gold); }
.ds-lang-select option { background: var(--card); color: var(--text); }

/* Responsive */
@media (max-width: 1000px) {
  .ds-grid { grid-template-columns: 1fr; }
  .ds-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  body.ds-app { grid-template-columns: 1fr; }
  .ds-side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    gap: 4px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .ds-logo { padding: 4px 8px 4px 4px; margin-bottom: 0; }
  .ds-logo-text { display: none; }
  .ds-side-section { display: none; }
  #side-nav, #side-nav-2, #side-nav-3 { flex-direction: row; gap: 2px; }
  #side-nav a span:not(.ds-badge), #side-nav-2 a span:not(.ds-badge), #side-nav-3 a span:not(.ds-badge) { display: none; }
  .ds-side-foot { display: none; }
  .ds-main { height: auto; }
  .ds-content { padding: 18px 16px 40px 16px; }
  .ds-topbar { padding: 12px 16px; flex-wrap: wrap; }
  .ds-search { width: 100%; max-width: none; order: 2; }
  .ds-kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .ds-kpi-num { font-size: 26px; }
  .ds-form-row, .ds-form-two-col { grid-template-columns: 1fr; }
}


/* ============== New Request — structured panels ============== */

.ds-form h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.05;
  color: var(--text);
  margin: 0 0 8px 0;
}
.ds-form > p.muted {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 0 0 36px 0;
  max-width: 560px;
  line-height: 1.55;
}

.ds-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 26px 28px 24px;
  margin-bottom: 18px;
}
.ds-panel-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 4px;
}
.ds-panel-num {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 15px;
  color: var(--text-dim);
  font-style: italic;
  letter-spacing: .02em;
  min-width: 22px;
}
.ds-panel-title {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -.015em;
  color: var(--text);
  line-height: 1.15;
}
.ds-panel-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin: 6px 0 22px 36px;
  line-height: 1.5;
  max-width: 520px;
}

.ds-form label {
  display: block;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 8px 0;
  font-weight: 500;
}




/* Real select with custom arrow */

.ds-form select option { background: var(--card); color: var(--text); }

.ds-form input::placeholder,
.ds-form textarea::placeholder { color: var(--text-faint); }

.ds-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ds-form-row > div { margin-bottom: 0; }

.ds-form-two-col {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0 40px;
  align-items: start;
}


.ds-section-mini {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--text);
  margin: 0 0 6px 0;
}
.ds-section-mini + p {
  color: var(--text-muted);
  font-size: 12.5px;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

/* Drop zones — softer, editorial */
.ds-drop {
  border: 1px dashed rgba(255,255,255,.20);
  border-radius: 4px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  background: rgba(255,255,255,.012);
  margin-bottom: 16px;
}
.ds-drop:hover, .ds-drop.over {
  border-color: rgba(255,255,255,.40);
  background: rgba(255,255,255,.03);
}
.ds-drop svg {
  width: 24px;
  height: 24px;
  color: var(--text-dim);
  margin: 0 auto 14px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
}
.ds-drop strong {
  color: var(--text);
  font-size: 13.5px;
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: -.005em;
}
.ds-drop span {
  color: var(--text-dim);
  font-size: 12px;
  display: block;
  line-height: 1.5;
}
.ds-drop input[type="file"] { display: none; }

.ds-drop-filled {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(74,124,89,.10);
  border: 1px solid rgba(74,124,89,.35);
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 13px;
}
.ds-drop-filled svg { width: 16px; height: 16px; color: #6fb37f; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.ds-drop-filled .name { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-drop-filled button { background: transparent; border: 0; color: var(--text-dim); cursor: pointer; padding: 4px; }
.ds-drop-filled button:hover { color: var(--text); }

/* Add-signer ghost button */
.ds-add-signer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px dashed var(--border-2);
  color: var(--text-muted);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  margin-top: 4px;
}
.ds-add-signer:hover { border-color: rgba(255,255,255,.28); color: var(--text); }

/* Sticky footer bar for the send action */
.ds-form-footer {
  position: sticky;
  bottom: 0;
  margin-top: 26px;
  padding: 18px 0;
  background: transparent 0%, rgba(20,20,26,.92) 40%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  border-top: 1px solid var(--border);
}
.ds-form-footer .ds-btn {
  padding: 13px 22px;
  font-size: 13.5px;
}
.ds-form-footer .ds-btn-ghost {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-muted);
  padding: 13px 18px;
  border-radius: 4px;
  font-size: 13.5px;
  cursor: pointer;
}
.ds-form-footer .ds-btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,.28); }

/* Page header polish */
.ds-page-head h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.02;
}
.ds-page-head .sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 8px;
}


/* ============== New Request — final structured form ============== */

/* Page header */
.ds-page-head {
  margin: 0 0 20px 0;
  padding: 0 0 16px 0;
  border-bottom: 1px solid var(--border);
}
.ds-page-head h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -.015em;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 5px 0;
}
.ds-page-head .sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0;
  max-width: 520px;
  line-height: 1.5;
}

/* Form container */


/* Panels: tight, bordered, dense */
.ds-panel {
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 16px 20px 18px;
}
.ds-panel-head {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  column-gap: 0;
  margin-bottom: 2px;
}
.ds-panel-num {
  font-family: "Inter Tight", "Inter", system-ui, sans-serif;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: .05em;
  line-height: 1;
}
.ds-panel-title {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -.005em;
  line-height: 1.2;
  color: var(--text);
  margin: 0;
}
.ds-panel-sub {
  color: var(--text-muted);
  font-size: 12px;
  margin: 2px 0 14px 24px;
  line-height: 1.45;
  max-width: 520px;
}

/* Fields: strong border, clear label, tight spacing */
.ds-field { margin-bottom: 12px; }
.ds-field:last-child { margin-bottom: 0; }
.ds-field-label,
.ds-field label {
  display: block;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  margin: 0 0 5px 0;
}
.ds-field input,
.ds-field select,
.ds-field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 8px 11px;
  border-radius: 3px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
  appearance: none;
  margin: 0;
  line-height: 1.35;
}
.ds-field input:hover,
.ds-field select:hover,
.ds-field textarea:hover { border-color: var(--text-faint); }
.ds-field input:focus,
.ds-field select:focus,
.ds-field textarea:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.ds-field select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7285' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 32px;
  cursor: pointer;
}
.ds-field select option { background: var(--card); color: var(--text); }
.ds-field input::placeholder,
.ds-field textarea::placeholder { color: var(--text-faint); }

.ds-hint-inline {
  color: var(--text-faint);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 10.5px;
}

/* Two-column: divider is a right border on the left col, no pseudo-element */
.ds-form-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: start;
  margin-top: 4px;
}
.ds-form-two-col > .ds-col:first-child {
  padding-right: 28px;
  border-right: 1px solid var(--border);
}
.ds-form-two-col > .ds-col:last-child {
  padding-left: 28px;
}
.ds-col { min-width: 0; }

.ds-section-mini {
  font-family: "Inter Tight", "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 4px 0;
}
.ds-section-help {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0 0 14px 0;
  line-height: 1.5;
}

/* Add signer */
.ds-add-signer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-muted);
  padding: 7px 11px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .12s, color .12s;
  margin-top: 4px;
}
.ds-add-signer:hover { border-color: var(--text); color: var(--text); }

/* Drop zones: solid background, visible dashed line */
.ds-drop {
  border: 1px dashed var(--border-2);
  border-radius: 3px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
  background: var(--bg);
  margin: 0 0 10px 0;
}
.ds-drop:hover, .ds-drop.over {
  border-color: var(--text);
  background: var(--card);
}
.ds-drop svg {
  width: 18px; height: 18px;
  color: var(--text-dim);
  margin: 0 auto 8px;
  display: block;
  stroke: currentColor; fill: none; stroke-width: 1.4;
}
.ds-drop strong {
  color: var(--text);
  font-size: 12.5px;
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
}
.ds-drop span {
  color: var(--text-muted);
  font-size: 11px;
  display: block;
  line-height: 1.45;
}
.ds-drop input[type="file"] { display: none; }

.ds-drop-filled {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  background: var(--gold-soft);
  border: 1px solid var(--border-2);
  border-radius: 3px;
  margin: 0 0 10px 0;
  font-size: 12px;
}
.ds-drop-filled svg { width: 14px; height: 14px; color: var(--ok); stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.ds-drop-filled .name { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-drop-filled button { background: transparent; border: 0; color: var(--text-dim); cursor: pointer; padding: 4px; }
.ds-drop-filled button:hover { color: var(--fail); }

.ds-form-err {
  color: var(--fail);
  font-size: 12px;
  min-height: 14px;
  margin: 0;
}

/* Footer: inline, clearly the last block */
.ds-form-footer {
  position: static;
  margin: 4px 0 0 0;
  padding: 14px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.ds-form-footer .ds-btn {
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 3px;
}
.ds-form-footer .ds-btn-ghost {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-muted);
  padding: 9px 16px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}
.ds-form-footer .ds-btn-ghost:hover { color: var(--text); border-color: var(--text); }

@media (max-width: 900px) {
  .ds-form-two-col { grid-template-columns: 1fr; gap: 20px; }
  .ds-form-two-col > .ds-col:first-child {
    padding-right: 0;
    border-right: 0;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
  }
  .ds-form-two-col > .ds-col:last-child { padding-left: 0; padding-top: 4px; }
}


/* ============== INPUT SANITY — must win the cascade ============== */
.ds-form .ds-field input,
.ds-form .ds-field select,
.ds-form .ds-field textarea,
.ds-form input,
.ds-form select,
.ds-form textarea {
  background: var(--bg) !important;
  border: 1px solid var(--border-2) !important;
  color: var(--text) !important;
  padding: 9px 11px !important;
  border-radius: 3px !important;
  font-size: 13px !important;
  font-family: inherit !important;
  line-height: 1.35 !important;
  outline: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 100% !important;
  transition: border-color .12s ease, box-shadow .12s ease !important;
}
.ds-form input:hover,
.ds-form select:hover,
.ds-form textarea:hover {
  border-color: var(--text-faint) !important;
}
.ds-form input:focus,
.ds-form select:focus,
.ds-form textarea:focus {
  border-color: var(--text) !important;
  box-shadow: 0 0 0 3px var(--gold-soft) !important;
  outline: none !important;
}

/* Custom arrow on all selects (dark + light both handled by the fill value) */
.ds-form select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a85' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 11px center !important;
  background-size: 12px !important;
  padding-right: 32px !important;
  cursor: pointer !important;
}
.ds-form select::-ms-expand { display: none; }
.ds-form select option {
  background: var(--card);
  color: var(--text);
}

/* Kill native number spinners etc */
.ds-form input[type=number]::-webkit-outer-spin-button,
.ds-form input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.ds-form input[type=number] { -moz-appearance: textfield; }

/* Also fix the Settings page which uses same .ds-form pattern */
.ds-panel .ds-field input,
.ds-panel .ds-field select,
.ds-panel .ds-field textarea {
  background: var(--bg) !important;
  color: var(--text) !important;
  border-color: var(--border-2) !important;
}

/* ============== LAYOUT: Signer left narrow, Files right wider ============== */
.ds-form-two-col {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) !important;
  gap: 0 !important;
  align-items: start !important;
  margin-top: 4px !important;
}
.ds-form-two-col > .ds-col:first-child {
  padding-right: 26px !important;
  border-right: 1px solid var(--border) !important;
}
.ds-form-two-col > .ds-col:last-child {
  padding-left: 26px !important;
}

@media (max-width: 900px) {
  .ds-form-two-col {
    grid-template-columns: 1fr !important;
  }
  .ds-form-two-col > .ds-col:first-child {
    padding-right: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: 18px !important;
  }
  .ds-form-two-col > .ds-col:last-child {
    padding-left: 0 !important;
    padding-top: 18px !important;
  }
}

/* ============== Toast + error text fix ============== */
.ds-form-err {
  color: var(--fail) !important;
  font-size: 12px !important;
  min-height: 14px !important;
  margin: 6px 0 0 0 !important;
}

/* ============== Layout override: full-width form, 50/50 split ============== */
.ds-form {
  max-width: 100% !important;
  width: 100% !important;
}

.ds-panel {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Kill the panel-sub indent so it lines up with the panel title */
.ds-panel-sub {
  margin-left: 24px !important;
}

/* Two-column: exact 1fr / 1fr, both stretch full width */
.ds-form-two-col {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 0 !important;
  width: 100% !important;
  align-items: stretch !important;
}
.ds-form-two-col > .ds-col {
  min-width: 0 !important;
  width: 100% !important;
}
.ds-form-two-col > .ds-col:first-child {
  padding-right: 28px !important;
  border-right: 1px solid var(--border) !important;
}
.ds-form-two-col > .ds-col:last-child {
  padding-left: 28px !important;
}

/* Drop zones fill their column */
.ds-drop {
  width: 100% !important;
  box-sizing: border-box !important;
  display: block !important;
}
.ds-drop svg {
  display: block !important;
  margin: 0 auto 8px !important;
}

/* Inputs fill their column */
.ds-field input,
.ds-field select,
.ds-field textarea {
  width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 900px) {
  .ds-form-two-col {
    grid-template-columns: 1fr !important;
  }
  .ds-form-two-col > .ds-col:first-child {
    padding-right: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: 20px !important;
  }
  .ds-form-two-col > .ds-col:last-child {
    padding-left: 0 !important;
    padding-top: 20px !important;
  }
}


/* ============== FORCE LAYOUT — wins everything ============== */
form#new-form.ds-form,
.ds-form#new-form {
  max-width: 100% !important;
  width: 100% !important;
  display: block !important;
}
form#new-form > section.ds-panel,
.ds-panel {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: block !important;
}
.ds-form-two-col {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 0 !important;
  width: 100% !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
}
.ds-form-two-col > .ds-col {
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.ds-form-two-col > .ds-col:first-child {
  padding-right: 32px !important;
  border-right: 1px solid var(--border) !important;
}
.ds-form-two-col > .ds-col:last-child {
  padding-left: 32px !important;
}
.ds-drop {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: block !important;
}
.ds-drop svg {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.ds-field input,
.ds-field select,
.ds-field textarea {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.ds-panel-sub {
  margin-left: 24px !important;
}
.ds-page-head {
  max-width: 100% !important;
}
.ds-page-head .sub {
  max-width: 640px !important;
}

@media (max-width: 900px) {
  .ds-form-two-col { grid-template-columns: 1fr !important; }
  .ds-form-two-col > .ds-col:first-child {
    padding-right: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    padding-bottom: 20px !important;
  }
  .ds-form-two-col > .ds-col:last-child {
    padding-left: 0 !important;
    padding-top: 20px !important;
  }
}


/* ============== FIX: kill stray pseudo divider, force clean 50/50 ============== */
.ds-form-two-col::before {
  content: none !important;
  display: none !important;
}
.ds-form-two-col {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 0 !important;
  width: 100% !important;
}
.ds-form-two-col > .ds-col:first-child {
  padding-right: 32px !important;
  border-right: 1px solid var(--border) !important;
}
.ds-form-two-col > .ds-col:last-child {
  padding-left: 32px !important;
}

/* ============== Mobile: prevent iOS auto-zoom on input focus ============== */
@media (max-width: 900px) {
  .ds-form input,
  .ds-form select,
  .ds-form textarea,
  .ds-field input,
  .ds-field select,
  .ds-field textarea,
  .ds-search input,
  .ds-filters input,
  .ds-auth-card input {
    font-size: 16px !important;
  }
}

/* ============== District Seal Chat ============== */
.ds-chat-bubble{
  position:fixed;right:24px;bottom:24px;z-index:400;
  width:52px;height:52px;border-radius:50%;
  background:#c8102e;color:#fff;border:none;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;box-shadow:0 8px 24px rgba(0,0,0,.25);
  transition:transform .15s ease, background .15s ease;
}
.ds-chat-bubble:hover{background:#a50d25;transform:scale(1.05)}
.ds-chat-bubble:active{transform:scale(.97)}
.ds-chat-badge{
  position:absolute;top:-2px;right:-2px;
  background:#0a0a0b;color:#fff;font-size:10.5px;font-weight:700;
  min-width:20px;height:20px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  border:2px solid var(--bg,#f4f4f2);
}

.ds-chat-panel{
  position:fixed;right:24px;bottom:88px;z-index:401;
  width:380px;max-width:calc(100vw - 32px);height:min(620px,calc(100vh - 140px));
  background:var(--card,#fff);border:1px solid var(--border-2,rgba(0,0,0,.14));
  border-radius:6px;display:none;flex-direction:column;
  box-shadow:0 24px 60px rgba(0,0,0,.22);
  overflow:hidden;
}
.ds-chat-panel.open{display:flex}

.ds-chat-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:14px 16px;border-bottom:1px solid var(--border,rgba(0,0,0,.08));
  background:var(--card,#fff);
}
.ds-chat-head-info{display:flex;align-items:center;gap:11px;min-width:0}
.ds-chat-seal{position:relative;flex-shrink:0;width:36px;height:36px}
.ds-chat-seal img{width:36px;height:36px;border-radius:50%;display:block;object-fit:cover;background:var(--bg,#f4f4f2)}
.ds-chat-verified{
  position:absolute;bottom:-2px;right:-2px;
  width:16px;height:16px;border-radius:50%;
  background:#c8102e;color:#fff;
  display:flex;align-items:center;justify-content:center;
  border:2px solid var(--card,#fff);
}
.ds-chat-verified svg{width:9px;height:9px}
.ds-chat-title{
  font-family:'Instrument Serif',Georgia,serif;
  font-size:14.5px;letter-spacing:-.005em;line-height:1.2;
  color:var(--text,#0a0a0b);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.ds-chat-sub{
  font-size:11.5px;color:var(--text-dim,#8a8a85);
  margin-top:2px;display:flex;align-items:center;gap:6px;
}
.ds-chat-dot{
  width:6px;height:6px;border-radius:50%;background:#4a7c59;
  box-shadow:0 0 0 3px rgba(74,124,89,.18);
}
.ds-chat-close{
  background:transparent;border:0;color:var(--text-dim,#8a8a85);
  cursor:pointer;padding:6px;border-radius:3px;
  display:flex;align-items:center;justify-content:center;
}
.ds-chat-close:hover{color:var(--text,#0a0a0b);background:var(--hover,rgba(0,0,0,.04))}
.ds-chat-close svg{width:16px;height:16px}

.ds-chat-body{
  flex:1;overflow-y:auto;padding:18px 16px 14px 16px;
  background:var(--bg,#f4f4f2);
  display:flex;flex-direction:column;gap:10px;
}
.ds-chat-body::-webkit-scrollbar{width:6px}
.ds-chat-body::-webkit-scrollbar-thumb{background:rgba(0,0,0,.15);border-radius:3px}

.ds-chat-empty{
  color:var(--text-dim,#8a8a85);font-size:12.5px;
  text-align:center;padding:30px 20px;
}

.ds-chat-msg{
  max-width:78%;padding:9px 12px;border-radius:8px;
  font-size:13px;line-height:1.45;word-wrap:break-word;white-space:pre-wrap;
}
.ds-chat-msg.user{
  align-self:flex-end;background:#c8102e;color:#fff;
  border-bottom-right-radius:2px;
}
.ds-chat-msg.admin{
  align-self:flex-start;background:var(--card,#fff);
  color:var(--text,#0a0a0b);border:1px solid var(--border,rgba(0,0,0,.08));
  border-bottom-left-radius:2px;
}
.ds-chat-msg-time{
  font-size:10.5px;color:var(--text-faint,#b8b8b4);
  margin-top:3px;align-self:flex-end;
}
.ds-chat-msg.admin + .ds-chat-msg-time,
.ds-chat-msg-time.admin{align-self:flex-start}

.ds-chat-foot{
  padding:12px 14px;border-top:1px solid var(--border,rgba(0,0,0,.08));
  background:var(--card,#fff);
}
.ds-chat-input-wrap{
  display:flex;gap:8px;align-items:flex-end;
}
.ds-chat-input-wrap textarea{
  flex:1;resize:none;border:1px solid var(--border-2,rgba(0,0,0,.14));
  border-radius:6px;padding:9px 12px;font-size:13px;
  font-family:inherit;outline:none;color:var(--text,#0a0a0b);
  background:var(--bg,#f4f4f2);min-height:38px;max-height:120px;
  line-height:1.4;
}
.ds-chat-input-wrap textarea:focus{border-color:#c8102e}
.ds-chat-send{
  width:38px;height:38px;border-radius:6px;
  background:#c8102e;color:#fff;border:none;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;transition:background .15s ease;
}
.ds-chat-send:hover{background:#a50d25}
.ds-chat-send:disabled{opacity:.4;cursor:not-allowed}

.ds-chat-lock{
  text-align:center;padding:8px 6px 4px 6px;
}
.ds-chat-lock-title{
  font-family:'Instrument Serif',Georgia,serif;
  font-size:15.5px;color:var(--text,#0a0a0b);margin-bottom:5px;
}
.ds-chat-lock-sub{
  font-size:12px;color:var(--text-dim,#8a8a85);
  line-height:1.5;margin-bottom:12px;max-width:300px;margin-left:auto;margin-right:auto;
}

@media (max-width:480px){
  .ds-chat-panel{
    right:12px;left:12px;bottom:80px;
    width:auto;height:calc(100vh - 130px);
  }
  .ds-chat-bubble{right:16px;bottom:16px}
}

/* ============== ACCOUNT REVIEW BLOCK ============== */
#review-block{
  position:fixed;inset:0;z-index:9000;
  background:#0a0a0b;
  overflow-y:auto;
}
#review-block .rv-wrap{
  min-height:100vh;display:flex;align-items:center;justify-content:center;
  padding:40px 24px;
}
#review-block .rv-card{
  max-width:560px;width:100%;
  background:#111112;
  border:1px solid rgba(255,255,255,.10);
  border-radius:4px;
  padding:48px 44px 40px;
  position:relative;
}
#review-block .rv-mark{
  width:44px;height:44px;margin-bottom:26px;
}
#review-block .rv-mark img{width:100%;height:100%;display:block}
#review-block .rv-eyebrow{
  font-size:10.5px;letter-spacing:.2em;text-transform:uppercase;
  color:#c8102e;font-weight:700;margin-bottom:18px;
}
#review-block .rv-title{
  font-family:"Instrument Serif",Georgia,serif;
  font-weight:400;
  font-size:32px;line-height:1.1;letter-spacing:-.02em;
  color:#f4f4f2;margin:0 0 18px 0;
}
#review-block .rv-body{
  font-size:14.5px;line-height:1.65;color:#9a9a95;
  margin:0 0 30px 0;max-width:480px;
}
#review-block .rv-info{
  border-top:1px solid rgba(255,255,255,.08);
  border-bottom:1px solid rgba(255,255,255,.08);
  padding:16px 0;margin-bottom:24px;
}
#review-block .rv-row{
  display:flex;justify-content:space-between;gap:16px;
  padding:8px 0;font-size:13px;
}
#review-block .rv-row .rv-k{
  font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;
  color:#6e6e69;font-weight:600;padding-top:3px;
}
#review-block .rv-row .rv-v{
  color:#f4f4f2;font-weight:500;text-align:right;
  font-family:"JetBrains Mono",ui-monospace,monospace;font-size:12.5px;
}
#review-block .rv-foot{
  font-size:13px;line-height:1.6;color:#6e6e69;
  margin:0 0 30px 0;max-width:480px;
}
#review-block .rv-actions{
  display:flex;gap:10px;flex-wrap:wrap;
}
#review-block .rv-btn-ghost{
  display:inline-flex;align-items:center;justify-content:center;
  padding:10px 18px;
  background:transparent;color:#f4f4f2;
  border:1px solid rgba(255,255,255,.14);
  border-radius:3px;
  font-size:13px;font-weight:500;
  cursor:pointer;font-family:inherit;
  text-decoration:none;
  transition:border-color .15s,color .15s;
}
#review-block .rv-btn-ghost:hover{
  border-color:#f4f4f2;color:#fff;
}

@media (max-width:600px){
  #review-block .rv-card{padding:36px 26px 30px}
  #review-block .rv-title{font-size:26px}
}

/* ============ Profile view (read-only key/value rows) ============ */
.ds-profile {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  overflow: hidden;
}
.ds-profile-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.ds-profile-row:last-child { border-bottom: 0; }
.ds-profile-label {
  flex: 0 0 220px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  padding-top: 2px;
}
.ds-profile-value {
  flex: 1 1 auto;
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.55;
  word-break: break-word;
}
@media (max-width: 640px) {
  .ds-profile-row { flex-direction: column; gap: 6px; }
  .ds-profile-label { flex: none; }
}

/* ============ New request — two-column with live preview ============ */
.ds-new-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 1080px) {
  .ds-new-grid { grid-template-columns: 1fr; }
  .ds-new-right { position: static !important; }
}
.ds-new-right {
  position: sticky;
  top: 24px;
}
.ds-preview-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  padding: 22px;
}
.ds-preview-head {
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 18px;
}
.ds-preview-block { margin-bottom: 18px; }
.ds-preview-label {
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 6px;
}
.ds-preview-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}
.ds-preview-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
  word-break: break-word;
}
.ds-preview-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}
.ds-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}
.ds-preview-row strong { color: var(--text); font-weight: 600; }

/* ============ API Quickstart panel ============ */
.ds-qs {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.015), rgba(255,255,255,0));
  overflow: hidden;
}
.ds-qs-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
}
.ds-qs-eyebrow {
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
.ds-qs-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -.01em;
  margin: 0 0 6px;
  color: var(--text);
}
.ds-qs-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 480px;
}
.ds-qs-docs {
  color: var(--gold);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 0;
}
.ds-qs-docs:hover { text-decoration: underline; }

.ds-qs-tabs {
  display: flex;
  gap: 0;
  padding: 0 24px;
  background: rgba(0,0,0,.15);
  border-bottom: 1px solid var(--border);
}
.ds-qs-tab {
  background: none;
  border: 0;
  padding: 12px 4px;
  margin-right: 22px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s;
}
.ds-qs-tab:hover { color: var(--text); }
.ds-qs-tab.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}

.ds-qs-codewrap {
  position: relative;
  background: #050b16;
}
.ds-qs-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: .02em;
  transition: all .15s;
}
.ds-qs-copy:hover {
  background: rgba(255,255,255,.1);
  color: var(--text);
  border-color: rgba(255,255,255,.2);
}
.ds-qs-code {
  margin: 0;
  padding: 22px 24px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  line-height: 1.75;
  color: #cbd5e1;
  overflow-x: auto;
  white-space: pre;
}
.ds-qs-cmd   { color: #f472b6; font-weight: 600; }
.ds-qs-flag  { color: #93c5fd; }
.ds-qs-url   { color: #7dd3fc; }
.ds-qs-str   { color: #86efac; }
.ds-qs-kw    { color: #c084fc; }
.ds-qs-fn    { color: #7dd3fc; }
.ds-qs-comment { color: #64748b; font-style: italic; }

.ds-qs-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 24px;
  font-size: 12.5px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.1);
}
.ds-qs-foot a {
  color: var(--gold);
  text-decoration: none;
}
.ds-qs-foot a:hover { text-decoration: underline; }
