/* Shared workspace presentation; public pages and authentication stay unchanged. */
.dd-ux {
  --dd-ink: #20312e;
  --dd-muted: #5d6b68;
  --dd-line: #dce4e1;
  --dd-green: #08654d;
  --dd-blue: #235b88;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--dd-ink);
  background: #f5f7f6;
  line-height: 1.5;
  font-size: 14px;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.dd-ux *, .dd-ux *::before, .dd-ux *::after { box-sizing: border-box; letter-spacing: 0; }
.dd-ux :is(h1,h2,h3,h4,p,button,a,label,b,strong,small,input,select,textarea) { font-family: inherit; }
.dd-ux :is(b,strong,button,a,small,th,td,label) { font-family: Arial, Helvetica, sans-serif !important; letter-spacing: 0 !important; }
.dd-ux :is(h1,h2,h3,h4,p,label,small,td,th) { overflow-wrap: anywhere; }
.dd-ux h1 { font-size: 28px; line-height: 1.2; font-weight: 700; margin: 4px 0 0; color: #172c26; }
.dd-ux h2 { font-size: 20px; line-height: 1.35; font-weight: 700; }
.dd-ux h3 { font-size: 17px; line-height: 1.4; }
.dd-ux p { line-height: 1.55; }
.dd-ux :is(button,a,input,select,textarea,summary):focus-visible { outline: 3px solid #2372ac; outline-offset: 3px; }
.dd-ux :is(button,a) { -webkit-tap-highlight-color: transparent; }
.dd-ux :is(button,input,select,textarea) { font-size: 14px; }
.dd-ux :is(button,.primary,.secondary,.context-switch) { border-radius: 6px; }
.dd-ux button { cursor: pointer; }
.dd-ux button:disabled { opacity: .55; cursor: not-allowed; }
.dd-ux :is(button,a) svg { flex-shrink: 0; }
.dd-ux :is(.sidebar,.control-sidebar) {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 0;
  background: #fff; color: var(--dd-ink); border-right: 1px solid var(--dd-line);
  padding: 18px 12px 56px; overflow-y: auto; min-width: 0;
}
.dd-ux :is(.sidebar,.control-sidebar) .brand {
  background: transparent; border: 0; border-radius: 0; padding: 0 8px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0;
}
.dd-ux :is(.sidebar,.control-sidebar) .brand img {
  width: 108px !important; max-width: 108px !important; height: 108px !important;
  object-fit: contain; margin: 0; aspect-ratio: 1;
}
.dd-ux :is(.sidebar,.control-sidebar) .brand small { color: #56655f; font-size: 11px; font-weight: 700; }
.dd-ux :is(.sidebar,.control-sidebar) nav { display: flex; flex-direction: column; gap: 4px; margin: 14px 0 20px; padding: 0; }
.dd-ux :is(.sidebar,.control-sidebar) nav button {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px;
  padding: 10px 12px; color: #485951; background: transparent;
  border: 1px solid transparent; border-left: 3px solid transparent; text-align: left; font-weight: 500; font-size: 14px;
}
.dd-ux :is(.sidebar,.control-sidebar) nav button:hover { background: #f1f5f3; color: #174f3c; }
.dd-ux :is(.sidebar,.control-sidebar) nav button.active {
  background: #e9f4ee; color: #09533d; border-left-color: #11805b; font-weight: 700;
}
.dd-ux .context-switch { color: var(--dd-blue); border: 1px solid var(--dd-line); padding: 10px; font-size: 12px; background: #fff; }
.dd-ux .idle-security-note { margin: auto 8px 12px; padding-top: 18px; color: #65746e; font-size: 11px; line-height: 1.5; }
.dd-ux .logout { background: transparent; color: #485951; border: 1px solid var(--dd-line); padding: 10px; width: 100%; justify-content: center; font-size: 12px; margin: 0; }
.dd-ux :is(.workspace,.control-workspace) { min-width: 0; width: 100%; max-width: 1560px; margin: 0 auto; padding: 28px 32px 60px; }
.dd-ux :is(.workspace,.control-workspace) > header { align-items: center; gap: 18px; margin: 0 0 24px; padding-bottom: 20px; border-bottom: 1px solid var(--dd-line); }
.dd-ux .eyebrow { color: #5c6d64; font-size: 11px; font-weight: 600; margin: 0; }
.dd-ux .user { font-size: 12px; min-width: 0; gap: 9px; }
.dd-ux .user > span { width: 36px; height: 36px; min-width: 36px; background: #e7edf4; color: #235b88; font-size: 14px; }
.dd-ux .user small { color: #64746a; font-size: 11px; }
.dd-ux .dd-header-account { gap: 12px; }
.dd-ux .balance { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: center; background: #fff; color: var(--dd-ink); padding: 14px 18px; border: 1px solid var(--dd-line); border-radius: 6px; margin: 0 0 24px; }
.dd-ux .balance small { color: var(--dd-muted); font-size: 10px; }
.dd-ux .balance b { color: #185840; font-size: 20px; line-height: 1.3; }
.dd-ux .balance > div { min-width: 92px; padding: 0 18px 0 0; gap: 4px; }
.dd-ux .balance > span { margin-left: auto; font-size: 12px; color: var(--dd-muted); max-width: 260px; }
.dd-ux .search-form { max-width: 1120px; padding: 0; background: transparent; border: 0; box-shadow: none; }
.dd-ux .section-title { margin: 28px 0 16px; gap: 12px; align-items: flex-start; }
.dd-ux .section-title:first-child { margin-top: 0; }
.dd-ux .section-title > span { width: 28px; height: 28px; min-width: 28px; background: #e4eee8; color: #196348; font-size: 13px; }
.dd-ux .section-title h2 { margin: 0; font-size: 18px; }
.dd-ux .section-title p { margin: 4px 0 0; color: var(--dd-muted); font-size: 13px; }
.dd-ux .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.dd-ux .product { position: relative; min-height: 134px; padding: 18px 42px 18px 18px; text-align: left; background: #fff; border: 1px solid #cbd7d0; border-radius: 6px; box-shadow: none; }
.dd-ux .product.selected { border-color: #16845e; background: #edf7f1; box-shadow: inset 0 0 0 1px #16845e; }
.dd-ux .product b { font-size: 16px; color: #164732; font-weight: 700; }
.dd-ux .product > span { display: block; margin-top: 8px; font-size: 13px; color: #53645a; line-height: 1.5; }
.dd-ux .product > svg { position: absolute; right: 16px; top: 20px; width: 20px; height: 20px; color: #0d7654; }
.dd-ux .dd-pricing-details { margin: 0 0 18px; border-block: 1px solid var(--dd-line); }
.dd-ux .dd-pricing-details > summary { cursor: pointer; color: var(--dd-blue); padding: 12px 2px; font-weight: 600; font-size: 13px; }
.dd-ux .dd-pricing-details[open] { padding-bottom: 12px; }
.dd-ux .dd-pricing-details :is(section,article) { background: transparent; border-radius: 0; box-shadow: none; }
.dd-ux .mode-row { gap: 12px; align-items: stretch; margin-bottom: 24px; }
.dd-ux .mode-row > label { border: 1px solid var(--dd-line); background: #fff; padding: 14px; border-radius: 6px; }
.dd-ux .mode-title { font-size: 14px; font-weight: 600; }
.dd-ux .monitor-cost-note { font-size: 11px; color: var(--dd-muted); }
.dd-ux :is(.grid,.control-form-grid) { gap: 18px 20px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.dd-ux :is(label,.field-label) { font-size: 13px; font-weight: 600; color: #344a3e; min-width: 0; }
.dd-ux :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {
  display: block; width: 100%; max-width: 100%; min-width: 0; background: #fff;
  border: 1px solid #b8c9bf; border-radius: 5px; padding: 11px 12px; color: #233b2d; min-height: 44px;
  font-size: 14px; font-weight: 400; line-height: 1.4;
}
.dd-ux textarea { min-height: 100px; resize: vertical; }
.dd-ux :is(input,textarea)::placeholder { color: #75837a; font-weight: 400; opacity: 1; }
.dd-ux input[readonly] { background: #eaf0ed; color: #5b6a62; }
.dd-ux input:is([type=checkbox],[type=radio]) { width: 17px; height: 17px; min-width: 17px; margin: 2px 0 0; accent-color: var(--dd-green); }
.dd-ux label small { font-size: 11px; font-weight: 400; color: var(--dd-muted); line-height: 1.5; }
.dd-ux .document-upload { background: #fff; border: 1px dashed #b6c9be; border-radius: 6px; padding: 20px; margin-top: 22px; }
.dd-ux .token-cost { background: #eaf1f8; border: 1px solid #cbdbea; color: #254c6c; border-radius: 6px; padding: 18px; margin: 22px 0 18px; }
.dd-ux .token-cost h3 { font-size: 15px; }
.dd-ux .token-cost p { font-size: 13px; }
.dd-ux .consent { display: flex; align-items: flex-start; gap: 12px; margin: 22px 0; font-size: 13px; font-weight: 400; line-height: 1.65; color: #43564b; }
.dd-ux :is(.primary,.run-button) { background: #0b654c; color: #fff; padding: 12px 18px; border: 1px solid #0b654c; font-size: 14px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.dd-ux :is(.primary,.run-button):hover:not(:disabled) { background: #074d39; }
.dd-ux .secondary { background: #fff; border: 1px solid #bfcdc4; color: #245940; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; min-height: 42px; font-weight: 600; }
.dd-ux :is(.control-panel,.commercial-card,.empty,.monitor-note) { background: transparent; border: 0; border-radius: 0; padding: 24px 0; margin: 0; box-shadow: none; }
.dd-ux .control-panel { border-top: 1px solid var(--dd-line); }
.dd-ux .panel-title { margin-bottom: 20px; }
.dd-ux :is(.commercial-control,.token-control) { background: transparent; border: 0; border-left: 2px solid var(--dd-line); border-radius: 0; padding: 0 18px; }
.dd-ux .control-panel > header { gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.dd-ux .control-panel > header h2 { font-size: 18px; }
.dd-ux .control-panel > header p { color: var(--dd-muted); font-size: 13px; max-width: 80ch; }
.dd-ux .control-columns { gap: 28px; align-items: start; }
.dd-ux .control-columns > * { min-width: 0; }
.dd-ux .control-kpis { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 20px 0 24px; }
.dd-ux .control-kpis article { background: #fff; border: 1px solid var(--dd-line); border-radius: 6px; box-shadow: none; padding: 18px; min-width: 0; }
.dd-ux .control-kpis article:nth-child(2) svg { color: #245f91; }
.dd-ux .control-kpis article:nth-child(3) svg { color: #886917; }
.dd-ux .control-kpis article:nth-child(4) svg { color: #874e48; }
.dd-ux .control-kpis b { font-size: 26px; color: #253b2d; }
.dd-ux .control-kpis small { color: var(--dd-muted); }
.dd-ux :is(.control-status,.control-notice,.mfa-error) { border-radius: 6px; padding: 14px 16px; font-size: 13px; line-height: 1.5; }
.dd-ux .control-status { background: #edf4f9; border: 1px solid #d0e0ec; color: #28506e; }
.dd-ux .control-notice { background: #eaf6ee; color: #215d35; }
.dd-ux .mfa-error { background: #fceded; color: #a33030; border: 1px solid #eacaca; }
.dd-ux .control-loading { min-height: 220px; color: var(--dd-muted); }
.dd-ux :is(.control-table-wrap,.records-table-wrap) { max-width: 100%; min-width: 0; overflow: auto; border: 1px solid var(--dd-line); border-radius: 6px; background: #fff; margin-top: 12px; }
.dd-ux table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dd-ux th { padding: 12px; font-size: 11px; font-weight: 700; color: #53685b; background: #eef2ef; border-bottom: 1px solid var(--dd-line); white-space: nowrap; }
.dd-ux td { padding: 14px 12px; vertical-align: top; border-bottom: 1px solid #e8eeea; }
.dd-ux td small { display: block; margin-top: 4px; color: #6b786f; font-size: 11px; }
.dd-ux tbody tr:hover { background: #f6f9f7; }
.dd-ux td button { white-space: nowrap; min-height: 36px; }
.dd-ux .dd-result-count { font-size: 12px; color: var(--dd-muted); margin: 10px 0 0; }
.dd-ux .dd-empty-state { padding: 36px 18px; text-align: center; color: var(--dd-muted); }
.dd-ux .status { border-radius: 4px; padding: 4px 8px; font-size: 11px; }
.dd-ux .status.active { color: #21623d; background: #e5f3e9; }
.dd-ux .status.suspended { color: #934329; background: #fbede5; }
.dd-ux :is(.source-engines,.records-panel,.private-list-panel) { min-width: 0; max-width: 100%; }
@media (max-width: 1180px) {
  .dd-ux { grid-template-columns: 204px minmax(0,1fr); }
  .dd-ux :is(.workspace,.control-workspace) { padding: 24px 22px 60px; }
  .dd-ux .control-columns { grid-template-columns: minmax(0,1fr); }
  .dd-ux .control-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dd-ux .balance > span { max-width: none; margin-left: 0; }
}
@media (max-width: 800px) {
  .dd-ux { display: block; }
  .dd-ux :is(.sidebar,.control-sidebar) { position: static; height: auto; padding: 10px 16px 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; border-right: 0; border-bottom: 1px solid var(--dd-line); overflow: visible !important; }
  .dd-ux :is(.sidebar,.control-sidebar) .brand { flex-direction: row; padding: 0; gap: 10px; align-items: center; justify-content: flex-start; }
  .dd-ux :is(.sidebar,.control-sidebar) .brand img { width: 54px !important; height: 54px !important; max-width: 54px !important; }
  .dd-ux :is(.sidebar,.control-sidebar) .brand small { font-size: 11px; }
  .dd-ux :is(.sidebar,.control-sidebar) nav { grid-column: 1 / -1; grid-row: 3; display: flex; flex-direction: row; overflow-x: auto; gap: 4px; margin: 10px -4px 0; padding: 4px 4px 10px; }
  .dd-ux :is(.sidebar,.control-sidebar) nav button { flex: 0 0 auto; width: auto; white-space: nowrap; min-height: 44px; font-size: 13px; padding: 10px 12px; border-left: 1px solid transparent; border-bottom: 3px solid transparent; }
  .dd-ux :is(.sidebar,.control-sidebar) nav button.active { border-left-color: transparent; border-bottom-color: #11805b; }
  .dd-ux .logout { grid-column: 2; grid-row: 1; width: auto; font-size: 11px; padding: 9px; gap: 5px; }
  .dd-ux .idle-security-note { grid-row: 2; grid-column: 1 / -1; margin: 8px 0 0; padding: 0; font-size: 10px; }
  .dd-ux .context-switch { grid-row: 4; grid-column: 1 / -1; justify-content: flex-start; margin: 0 0 12px; font-size: 12px; border: 0; padding: 0; }
  .dd-ux :is(.workspace,.control-workspace) { padding: 22px 20px 70px; }
  .dd-ux :is(.workspace,.control-workspace) > header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .dd-ux .dd-header-account { flex-direction: row; align-items: center; flex-wrap: wrap; width: 100%; }
  .dd-ux .dd-workspace-header > div:first-child { flex: 0 0 auto; }
  .dd-ux .user div { display: flex; }
  .dd-ux .user { text-align: left; }
  .dd-ux .control-table-wrap table { min-width: 760px; }
  .dd-ux .control-panel table { font-size: 12px; }
}
@media (max-width: 540px) {
  .dd-ux h1 { font-size: 24px; }
  .dd-ux :is(.workspace,.control-workspace) { padding: 20px 16px 70px; }
  .dd-ux :is(.product-grid,.grid,.control-form-grid,.mode-row) { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; }
  .dd-ux .product { min-height: 118px; }
  .dd-ux .balance { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px 8px; padding: 14px; }
  .dd-ux .balance > div { min-width: 0; padding: 0; border: 0; }
  .dd-ux .balance > span { font-size: 11px; }
  .dd-ux .control-kpis { gap: 10px; }
  .dd-ux .control-kpis article { padding: 14px; }
  .dd-ux .control-kpis b { font-size: 23px; }
  .dd-ux .control-status { flex-wrap: wrap; gap: 12px; }
  .dd-ux .run-button { width: 100%; }
  .dd-ux .token-cost { flex-wrap: wrap; gap: 12px; }
  .dd-ux .consent { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .dd-ux *, .dd-ux *::before, .dd-ux *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
