:root {
  --bg: #f5f6f8;
  --paper: #fff;
  --ink: #202c40;
  --muted: #788497;
  --line: #e6eaf0;
  --accent: #4169e1;
  --soft: #edf2ff;
  --green: #18806b;
  --amber: #aa6e13;
  --red: #c24e54;
  --purple: #8061ba;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  color: var(--ink);
  font-size: 14px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #b3c4ff;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: 9px 13px;
  border-radius: 7px;
  font-weight: 550;
  transition: background 0.15s;
}
button:hover {
  background: #f2f5fa;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.primary:hover {
  background: #3458c5;
}
.danger {
  color: var(--red);
}
.quiet {
  background: transparent;
  border-color: transparent;
}
.small {
  padding: 6px 10px;
  font-size: 12px;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
input,
select,
textarea {
  border: 1px solid #dbe1ea;
  border-radius: 7px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
  min-height: 38px;
}
textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 27px;
  letter-spacing: -0.8px;
  font-weight: 650;
}
h2 {
  font-size: 16px;
  font-weight: 650;
}
h3 {
  font-size: 14px;
}
p {
  line-height: 1.6;
}
.muted {
  color: var(--muted);
}
.mono {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}
.money {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  white-space: nowrap;
}
.shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 29px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 29px;
  font-weight: 750;
  font-size: 21px;
  letter-spacing: -0.7px;
}
.brandmark {
  height: 32px;
  width: 32px;
  background: var(--accent);
  border-radius: 9px;
  color: white;
  display: grid;
  place-items: center;
  font-size: 20px;
}
.brand small {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 2px;
  display: block;
  font-weight: 500;
  margin-top: 1px;
}
.navlabel {
  font-size: 10px;
  letter-spacing: 1.2px;
  font-weight: 650;
  color: #9ba5b4;
  padding: 14px 12px 9px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px;
  color: #728096;
  border-radius: 7px;
  font-size: 13px;
  margin: 2px 0;
  font-weight: 500;
}
.nav:hover {
  background: #f6f8fc;
}
.nav.active {
  color: var(--accent);
  background: var(--soft);
  font-weight: 650;
}
.nav svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.nav .count {
  margin-left: auto;
  background: #f8e8e9;
  color: var(--red);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
}
.sidebottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eef2ff;
  color: var(--accent);
  font-weight: 650;
  font-size: 11px;
}
.userline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px;
}
.userline .muted {
  font-size: 11px;
  margin-top: 3px;
}
.main {
  min-width: 0;
}
.topbar {
  height: 69px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  gap: 20px;
}
.crumb {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.crumb b {
  color: #526079;
  font-weight: 500;
}
.topright {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
}
.statusdot {
  height: 6px;
  width: 6px;
  display: inline-block;
  border-radius: 50%;
  background: #69a68f;
  margin-right: 7px;
}
.demo-label {
  border: 1px solid #e2d5b7;
  color: #94733c;
  background: #fcf8ed;
  font-size: 10px;
  letter-spacing: 0.8px;
  border-radius: 4px;
  padding: 4px 7px;
  white-space: nowrap;
}
.content {
  padding: 30px 34px 45px;
  max-width: 1700px;
  margin: 0 auto;
}
.pagehead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 25px;
}
.subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}
.headtools,
.toolbar,
.row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 23px;
  flex-wrap: wrap;
}
.filters select {
  font-size: 12px;
  min-width: 150px;
}
.filters label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  display: grid;
  gap: 5px;
}
.filters .filterend {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  align-self: end;
  padding: 10px 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.metric {
  padding: 21px 23px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 121px;
}
.metric-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #7f8a9d;
}
.metric-title svg {
  width: 15px;
  height: 15px;
  color: #94a2b6;
}
.metric-value {
  font-size: 27px;
  letter-spacing: -0.8px;
  margin: 13px 0 9px;
  font-weight: 650;
}
.metric-value small {
  font-size: 13px;
  color: #9ca6b5;
  font-weight: 400;
  margin-left: 5px;
}
.metric-foot {
  font-size: 10px;
  color: var(--muted);
}
.metric-foot .green {
  color: var(--green);
}
.metric-foot .red {
  color: var(--red);
}
.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(290px, 1fr);
  gap: 20px;
  margin-bottom: 22px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  overflow: hidden;
  margin-bottom: 20px;
}
.grid2 .panel {
  margin-bottom: 0;
}
.panelhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 23px 17px;
}
.panelhead .muted {
  font-size: 11px;
  margin-top: 5px;
}
.panelbody {
  padding: 0 23px 20px;
}
.paneltitle {
  display: flex;
  gap: 9px;
  align-items: center;
}
.pill {
  display: inline-block;
  white-space: nowrap;
  font-size: 10px;
  border-radius: 5px;
  padding: 4px 7px;
  background: #f0f3f7;
  color: #758094;
  font-weight: 550;
}
.pill.ok {
  background: #e9f5f0;
  color: #22826b;
}
.pill.warn {
  background: #fcf2e1;
  color: #a77724;
}
.pill.bad {
  background: #fae9eb;
  color: #bf5961;
}
.pill.blue {
  background: #eaf0ff;
  color: #5674be;
}
.pill.purple {
  background: #f1ecfa;
  color: #8264ae;
}
.tablewrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}
th {
  font-size: 10px;
  color: #8b95a6;
  font-weight: 500;
  padding: 12px 22px;
  background: #fafbfd;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
td {
  padding: 15px 22px;
  border-bottom: 1px solid #edf0f4;
  font-size: 12px;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr[data-detail] {
  cursor: pointer;
}
tbody tr[data-detail]:hover {
  background: #fafbff;
}
.right {
  text-align: right;
}
.partnercell {
  display: flex;
  gap: 10px;
  align-items: center;
}
.partnericon {
  height: 31px;
  width: 31px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 750;
  color: white;
  flex-shrink: 0;
}
.subcell {
  font-size: 10px;
  color: #939cad;
  margin-top: 4px;
}
.bar {
  height: 7px;
  border-radius: 3px;
  background: #eef1f6;
  overflow: hidden;
  display: flex;
  min-width: 80px;
}
.bar span {
  display: block;
}
.bar .ok {
  background: #649f91;
}
.bar .warn {
  background: #deb66d;
}
.bar .bad {
  background: #d98088;
}
.chart {
  display: flex;
  align-items: end;
  height: 150px;
  gap: 14px;
  padding: 0 2px;
  border-bottom: 1px solid var(--line);
}
.chartcol {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: end;
  gap: 4px;
  position: relative;
  padding-bottom: 1px;
}
.chartcol > button {
  border: 0;
  border-radius: 3px 3px 0 0;
  padding: 0;
  min-width: 8px;
  flex: 1;
}
.chartcol .a {
  background: #657fe0;
}
.chartcol .b {
  background: #b9c5ec;
}
.chartlabels {
  display: flex;
  gap: 14px;
  padding-top: 9px;
  font-size: 10px;
  color: #8a96a9;
  text-align: center;
}
.chartlabels span {
  flex: 1;
}
.legend {
  display: flex;
  gap: 19px;
  font-size: 10px;
  color: #8a96a9;
  margin-top: 16px;
}
.legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  margin-right: 6px;
}
.flow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 15px 0;
}
.flowstep {
  flex: 1;
  font-size: 10px;
  color: var(--muted);
}
.flowstep strong {
  display: block;
  font-size: 18px;
  color: var(--ink);
  font-weight: 600;
  margin: 8px 0 5px;
}
.flowstep .line {
  height: 4px;
  background: #edf0f4;
  border-radius: 3px;
  margin-top: 12px;
}
.flowstep .line span {
  display: block;
  height: 100%;
  background: #7991de;
  border-radius: 3px;
}
.flowarrow {
  font-size: 16px;
  color: #bac4d1;
}
.notice {
  display: flex;
  gap: 11px;
  padding: 15px 0;
  border-bottom: 1px solid #edf0f4;
  align-items: start;
}
.notice:last-child {
  border-bottom: 0;
}
.notice-icon {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: #fcf2e1;
  color: #b38b44;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.notice b {
  font-size: 11px;
  display: block;
  font-weight: 550;
}
.notice p {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
.notice button {
  margin-left: auto;
  align-self: center;
}
.alertline {
  background: #f0f3fa;
  border: 1px solid #e0e6f2;
  color: #77839a;
  border-radius: 7px;
  padding: 12px 15px;
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.alertline.warn {
  background: #fcf6eb;
  border-color: #eee1c6;
  color: #967441;
}
.empty {
  padding: 35px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.tag {
  font-size: 10px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
  color: var(--muted);
}
.numbergreen {
  color: var(--green);
}
.numberred {
  color: var(--red);
}
.detailgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 18px 0;
}
.detailbox {
  background: #f7f9fc;
  border-radius: 7px;
  padding: 15px;
  min-width: 0;
}
.detailbox h3 {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.detailbox p {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.detailbox .value {
  font-size: 24px;
  margin-top: 10px;
}
.definition {
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: 12px;
  font-size: 12px;
  margin: 16px 0;
}
.definition dt {
  color: var(--muted);
}
.definition dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0;
}
.step {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafbfe;
  font-size: 11px;
}
.step b {
  display: block;
  margin-top: 5px;
}
.footerline {
  display: flex;
  justify-content: space-between;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.login {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
  background: white;
}
.login-story {
  padding: 10vh 8vw;
  background: #f0f3fa;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-story h1 {
  font-size: 46px;
  line-height: 1.15;
  max-width: 480px;
  margin: 35px 0 22px;
  letter-spacing: -2px;
}
.login-story p {
  max-width: 400px;
  color: #7e8ba0;
  font-size: 14px;
}
.login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.loginbox {
  width: 340px;
}
.loginbox h2 {
  font-size: 25px;
  margin-bottom: 10px;
}
.loginbox label {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  color: #768196;
  font-size: 12px;
}
.loginbox button {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
}
.login-note {
  padding: 18px;
  background: #f8f9fc;
  border-radius: 7px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 25px;
}
.error {
  font-size: 12px;
  color: var(--red);
  margin-top: 15px;
}
.boot {
  padding: 25vh 20px;
  text-align: center;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 13px;
  width: min(850px, calc(100vw - 36px));
  max-height: 90vh;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 24px 100px #14233c30;
}
dialog::backdrop {
  background: #16233d65;
  backdrop-filter: blur(2px);
}
.dialoghead {
  padding: 23px 27px 18px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}
.dialogbody {
  padding: 22px 27px;
}
.dialogfooter {
  padding: 17px 27px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: end;
  gap: 8px;
}
.dialogbody h3 {
  margin: 20px 0 10px;
}
.dialogbody .tablewrap {
  margin: 15px -15px;
}
.dialogbody th,
.dialogbody td {
  padding: 11px 13px;
}
.dialogbody pre {
  white-space: pre-wrap;
  word-break: break-all;
  background: #f7f9fc;
  padding: 14px;
  border-radius: 6px;
  font-size: 11px;
}
.dialogbody select,
.dialogbody input {
  width: 100%;
  margin-bottom: 12px;
}
.dialogbody label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin: 10px 0 6px;
}
#toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  max-width: min(420px, calc(100vw - 30px));
  background: #243551;
  color: white;
  padding: 14px 20px;
  border-radius: 9px;
  box-shadow: 0 6px 24px #23345125;
  z-index: 100;
  display: none;
  font-size: 12px;
  line-height: 1.5;
}
.toolbar input {
  min-width: 210px;
}
.searchline {
  padding: 0 23px 17px;
}
.auditrow {
  display: flex;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.auditdot {
  width: 8px;
  height: 8px;
  background: #8da2dc;
  border-radius: 50%;
  margin: 5px 5px;
  flex-shrink: 0;
}
.auditrow p {
  font-size: 11px;
  color: var(--muted);
  margin: 5px 0;
}
.auditrow b {
  font-size: 12px;
}
.labgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.help {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.65;
  margin: 12px 0;
}
.nowrap {
  white-space: nowrap;
}
.mobile-menu {
  display: none;
}
.balanceformula {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}
.balanceformula .formula {
  padding: 15px;
  background: #f7f9fc;
  border-radius: 8px;
}
.formula div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  font-size: 12px;
}
.formula .total {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-weight: 650;
}
.actionsline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.red {
  color: var(--red);
}
.green {
  color: var(--green);
}
.badge-number {
  font-size: 11px;
  background: #f0f3f9;
  padding: 3px 7px;
  border-radius: 5px;
}
.clicklink {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-weight: 500;
  font-size: 12px;
}
.scroll-list {
  max-height: 360px;
  overflow: auto;
}
@media (min-width: 1450px) {
  .content {
    padding-left: 43px;
    padding-right: 43px;
  }
  .metric-value {
    font-size: 30px;
  }
}
@media (max-width: 1150px) {
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .content {
    padding: 25px 22px;
  }
  .topbar {
    padding: 0 22px;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 17px 16px;
  }
  .metric-value {
    font-size: 23px;
  }
  .grid2 {
    grid-template-columns: 1.5fr 1fr;
  }
  td,
  th {
    padding-left: 16px;
    padding-right: 16px;
  }
  .topright .muted {
    display: none;
  }
}
@media (max-width: 850px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
    position: fixed;
    z-index: 50;
    width: 240px;
    box-shadow: 15px 0 100px #1d2c4233;
  }
  .sidebar.open {
    display: flex;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .grid2,
  .labgrid {
    grid-template-columns: 1fr;
  }
  .topbar {
    height: 60px;
    padding: 0 18px;
  }
  .content {
    padding: 23px 18px;
  }
  .pagehead {
    margin-bottom: 20px;
  }
  h1 {
    font-size: 23px;
  }
  .topright {
    gap: 7px;
  }
  .crumb {
    gap: 7px;
  }
  .filters select {
    min-width: 0;
    max-width: 100%;
  }
  .filters label {
    flex: 1;
    min-width: 130px;
  }
  .filters .filterend {
    width: 100%;
    padding: 0;
  }
  .headtools .tag {
    display: none;
  }
  .login {
    grid-template-columns: 1fr;
  }
  .login-story {
    display: none;
  }
  .login-form {
    min-height: 100vh;
  }
  .balanceformula,
  .detailgrid {
    grid-template-columns: 1fr;
  }
  .metric-value {
    font-size: 25px;
  }
  .panelhead {
    padding: 18px;
  }
  .panelbody {
    padding: 0 18px 18px;
  }
  .subtitle {
    line-height: 1.6;
  }
  .topright > span:not(.demo-label) {
    display: none;
  }
  .chart {
    gap: 10px;
  }
  .chartlabels {
    gap: 10px;
  }
  .chartcol {
    gap: 3px;
  }
  .headtools {
    justify-content: end;
  }
  .definition {
    grid-template-columns: 105px 1fr;
  }
  .dialogbody {
    padding: 18px;
  }
  .dialoghead,
  .dialogfooter {
    padding: 18px;
  }
  dialog {
    max-height: 94vh;
  }
  .filters {
    margin-bottom: 18px;
  }
  .flow {
    gap: 5px;
  }
  .flowarrow {
    font-size: 12px;
  }
  .flowstep {
    font-size: 9px;
  }
  .flowstep strong {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
button svg {
  width: 17px;
  height: 17px;
  vertical-align: middle;
}
.chartarea {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 7px;
}
.chartaxis {
  height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 9px;
  color: #8a96a9;
  text-align: right;
  padding: 0 0 3px;
}
.charttotals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 22px;
  font-size: 10px;
  color: var(--muted);
}
.charttotals strong {
  display: block;
  font-size: 17px;
  color: #596b96;
  font-weight: 600;
  margin-top: 8px;
}
.panelhead > div {
  min-width: 0;
}
.panelhead > a,
.panelhead > .clicklink {
  flex-shrink: 0;
}
tr[data-detail]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
@media (max-width: 850px) {
  .topbar .demo-label {
    font-size: 0;
  }
  .topbar .demo-label::after {
    content: "ДЕМО";
    font-size: 10px;
  }
  .topbar .crumb {
    min-width: 0;
    gap: 5px;
  }
  .topbar .crumb b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 145px;
  }
  .topright {
    flex-shrink: 0;
  }
  .topright button {
    white-space: nowrap;
    padding: 6px;
  }
  .charttotals strong {
    font-size: 14px;
  }
  .headtools button {
    white-space: nowrap;
  }
  .panelhead .clicklink {
    white-space: nowrap;
  }
}

.net-opportunity {
  margin-bottom: 22px;
  border: 1px solid #ccd8f7;
  background: #f3f6ff;
  border-radius: 10px;
  padding: 22px 24px;
}
.net-op-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.net-op-head h2 {
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.5;
}
.net-op-head p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.net-op-head button {
  flex-shrink: 0;
}
.net-op-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
.net-op-numbers > div {
  padding: 15px 17px;
  border: 1px solid #e0e7f7;
  border-radius: 8px;
  background: white;
}
.net-op-numbers > div > span {
  font-size: 11px;
  color: #7b89a2;
}
.net-op-numbers strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  font-weight: 650;
}
.net-op-numbers .net-op-focus {
  border-color: #aebfec;
}
.net-op-focus strong {
  color: #4169d1;
}
.net-op-after {
  border-top: 1px solid #dfe6f7;
  margin-top: 18px;
  padding-top: 14px;
  font-size: 11px;
  color: #667a9d;
  line-height: 1.8;
}
.net-op-after b {
  color: #3557ab;
}
@media (max-width: 850px) {
  .net-opportunity {
    padding: 18px;
  }
  .net-op-head {
    flex-direction: column;
    align-items: start;
  }
  .net-op-head h2 {
    font-size: 16px;
  }
  .net-op-numbers {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .net-op-numbers > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px;
  }
  .net-op-numbers strong {
    font-size: 17px;
    margin-top: 0;
  }
  .net-op-numbers > div > span {
    max-width: 140px;
  }
}

.advance-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 23px;
  background: #f0f7f4;
  border: 1px solid #d6e8df;
  border-radius: 9px;
  margin-bottom: 22px;
}
.advance-teaser p {
  font-size: 12px;
  margin: 8px 0 4px;
}
.advance-teaser button {
  flex-shrink: 0;
}
.advance-example {
  border: 1px solid #d1e4db;
  border-radius: 11px;
  background: white;
  margin-bottom: 24px;
  overflow: hidden;
}
.advance-example-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #f3f8f5;
  padding: 23px;
}
.advance-example-head h2 {
  font-size: 21px;
  letter-spacing: -0.4px;
  margin-top: 10px;
}
.advance-example-head p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.advance-example-head button {
  flex-shrink: 0;
}
.advance-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 23px;
}
.advance-metrics > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}
.advance-metrics > div > span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  display: block;
  min-height: 33px;
}
.advance-metrics strong {
  font-size: 22px;
  font-weight: 650;
  display: block;
  margin: 10px 0;
}
.advance-metrics small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.65;
  display: block;
}
.advance-metrics .advance-available {
  border-color: #a8cebd;
  background: #f5fbf8;
}
.advance-available strong {
  color: #217a5e;
}
.advance-progress {
  height: 13px;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  background: #edf2ef;
  margin: 0 23px;
}
.advance-progress span {
  display: block;
  height: 100%;
}
.advance-progress .principal {
  background: #7389d7;
}
.advance-progress .fee {
  background: #b4a0d8;
}
.advance-progress .released {
  background: #e6bd7e;
}
.advance-progress .available {
  background: #66aa91;
}
.advance-legend {
  margin: 15px 23px 22px;
  flex-wrap: wrap;
  row-gap: 9px;
}
.advance-periods-title {
  padding: 0 23px 17px;
}
.advance-periods-title p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 6px;
}
.advance-control {
  padding: 18px 23px;
  background: #f7faf8;
  border-top: 1px solid #e5ece8;
  display: flex;
  gap: 18px;
  align-items: center;
}
.advance-control > div {
  min-width: 0;
}
.advance-control b {
  font-size: 14px;
  font-weight: 600;
  color: #2b6b55;
  line-height: 1.8;
}
.advance-control p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.advance-control button {
  flex-shrink: 0;
}
.advance-example .tablewrap {
  border-top: 1px solid var(--line);
}
@media (max-width: 1150px) {
  .advance-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 850px) {
  .advance-teaser {
    align-items: start;
    flex-direction: column;
    padding: 18px;
  }
  .advance-example-head {
    flex-direction: column;
    align-items: start;
    padding: 18px;
  }
  .advance-example-head h2 {
    font-size: 19px;
    line-height: 1.5;
  }
  .advance-metrics {
    grid-template-columns: 1fr;
    margin: 18px;
    gap: 10px;
  }
  .advance-metrics > div {
    padding: 14px;
  }
  .advance-metrics > div > span {
    min-height: 0;
  }
  .advance-metrics strong {
    font-size: 23px;
    margin: 8px 0;
  }
  .advance-progress {
    margin: 0 18px;
  }
  .advance-legend {
    margin: 15px 18px 20px;
  }
  .advance-periods-title {
    padding: 0 18px 15px;
  }
  .advance-control {
    padding: 18px;
    align-items: start;
    flex-direction: column;
  }
  .advance-control b {
    font-size: 12px;
  }
}

.advance-period-cards {
  display: none;
}
@media (max-width: 850px) {
  .advance-example > .tablewrap {
    display: none;
  }
  .advance-period-cards {
    display: grid;
    gap: 10px;
    padding: 0 18px 18px;
  }
  .advance-period-card {
    text-align: left;
    padding: 15px;
    border: 1px solid #dce8e2;
    background: #fbfdfc;
  }
  .advance-period-date {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
  }
  .advance-period-date > span {
    color: var(--accent);
    font-size: 10px;
  }
  .advance-period-used {
    display: block;
    margin-top: 15px;
    font-size: 10px;
    color: var(--muted);
  }
  .advance-period-used strong {
    display: block;
    margin-top: 5px;
    font-size: 20px;
    font-weight: 650;
    color: var(--ink);
  }
  .advance-period-balance {
    display: block;
    margin-top: 12px;
    font-size: 10px;
    color: var(--muted);
  }
  .advance-period-balance b {
    display: block;
    margin-top: 5px;
    font-size: 15px;
    color: #28785b;
  }
  .advance-period-note {
    display: block;
    margin-top: 12px;
    font-size: 10px;
    color: var(--muted);
    line-height: 1.6;
  }
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.case-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: white;
  border-radius: 11px;
  padding: 24px;
  min-width: 0;
}
.case-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.case-card h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin-top: 18px;
  line-height: 1.4;
}
.case-description {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 5px;
  line-height: 1.7;
  min-height: 60px;
}
.case-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.case-metrics > div {
  border: 1px solid #e7ebf2;
  border-radius: 8px;
  padding: 14px;
  background: #fafbfd;
  min-width: 0;
}
.case-metrics > div > span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  display: block;
  min-height: 30px;
}
.case-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  font-weight: 650;
}
.case-metrics strong.warn {
  color: #a97826;
}
.case-metrics strong.green {
  color: #217d63;
}
.case-notes {
  padding-left: 17px;
  margin: 4px 0 22px;
  font-size: 11px;
  color: #7d899d;
  line-height: 1.8;
}
.case-notes li {
  margin: 5px 0;
}
.case-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}
.case-actions button {
  font-size: 11px;
  line-height: 1.5;
  white-space: normal;
}
.case-actions .primary {
  flex: 1;
}
.dialogbody > .case-metrics strong {
  font-size: 22px;
}
@media (max-width: 1100px) {
  .case-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 850px) {
  .case-card {
    padding: 18px;
  }
  .case-card h2 {
    font-size: 20px;
  }
  .case-metrics {
    gap: 9px;
  }
  .case-metrics > div {
    padding: 12px;
  }
  .case-metrics strong {
    font-size: 17px;
  }
  .case-metrics > div > span {
    font-size: 10px;
  }
  .case-description {
    min-height: 0;
  }
  .case-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .case-actions button {
    min-height: 38px;
  }
}
.mvp-banner {
  display: flex;
  gap: 18px;
  align-items: center;
  border: 1px solid #dbe4f2;
  background: #eef3fb;
  border-radius: 9px;
  padding: 12px 16px;
  margin-bottom: 22px;
  font-size: 12px;
  color: #4d6281;
}
.mvp-banner b {
  white-space: nowrap;
  color: #253d65;
}
.uuid {
  display: block;
  font-size: 10px;
  overflow-wrap: anywhere;
  color: #7d899b;
  margin-top: 6px;
  max-width: 250px;
}
.process-chain {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.process-chain > div {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 9px;
  min-height: 100px;
}
.process-chain small {
  display: block;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}
.process-chain b {
  font-size: 12px;
  line-height: 1.5;
  display: block;
}
.accounting-cases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 20px 0;
}
.accounting-cases .panelhead {
  min-height: 140px;
  align-items: start;
}
.accounting-cases .panelhead p {
  line-height: 1.6;
  font-size: 12px;
  color: var(--muted);
}
.formula {
  font-size: 20px;
  font-weight: 650;
  margin: 16px 0;
}
.setup-secret {
  display: block;
  background: #eef2f8;
  border: 1px solid var(--line);
  padding: 14px;
  overflow-wrap: anywhere;
  margin: 18px 0;
  letter-spacing: 1px;
}
.stat-row {
  margin: 24px 0;
}
.stat-row > div:first-child {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}
.stat-track {
  height: 12px;
  background: #edf0f7;
  border-radius: 4px;
  overflow: hidden;
}
.stat-track span {
  display: block;
  height: 100%;
  background: #577ae2;
  border-radius: 4px;
}
.api-link {
  display: block;
  width: 100%;
  text-align: left;
  margin: 10px 0;
  font-family: monospace;
  overflow-wrap: anywhere;
}
.architecture-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 20px 0;
}
.architecture-grid section {
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 8px;
}
.architecture-grid p {
  line-height: 1.7;
}
.login-form label {
  display: block;
  margin: 16px 0;
}
.login-form input {
  width: 100%;
}
.login-form .primary {
  width: 100%;
  margin-top: 10px;
}
.sidebar {
  overflow-y: auto;
}
.panelbody p {
  line-height: 1.7;
}
@media (max-width: 1100px) {
  .accounting-cases {
    grid-template-columns: 1fr;
  }
  .accounting-cases .panelhead {
    min-height: 0;
  }
  .architecture-grid {
    grid-template-columns: 1fr;
  }
  .mvp-banner {
    align-items: start;
    flex-direction: column;
    gap: 7px;
  }
}
@media (max-width: 650px) {
  .process-chain {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .process-chain > div {
    min-height: 0;
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 13px;
  }
  .process-chain small {
    margin: 0;
  }
  .mvp-banner {
    font-size: 11px;
  }
  .stat-row > div:first-child {
    flex-wrap: wrap;
  }
  .loginbox {
    max-width: 100%;
    padding: 20px;
  }
  .filters label {
    min-width: 120px;
  }
  button {
    min-height: 34px;
  }
}

@media (max-width: 650px) {
  .metrics {
    grid-template-columns: minmax(0, 1fr);
  }
  .metric {
    min-width: 0;
  }
  .metric-value {
    font-size: 25px;
  }
}
.v3-cases {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ledger-leg {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 14px 0;
}
.ledger-leg > span {
  float: right;
}
.ledger-leg .subcell {
  margin-top: 8px;
}
.v3-cases .panelhead {
  min-height: 165px;
}
details {
  margin: 12px 0;
}
summary {
  cursor: pointer;
  color: var(--accent);
}
.panelbody code.uuid {
  max-width: 100%;
  font-size: 11px;
}
@media (max-width: 1100px) {
  .v3-cases {
    grid-template-columns: 1fr;
  }
  .v3-cases .panelhead {
    min-height: 0;
  }
}
@media (max-width: 650px) {
  .ledger-leg > span {
    float: none;
    display: block;
    margin-top: 8px;
  }
}

/* Workspace context belongs to the shell, above the current page. */
.workspace-scope {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.workspace-scope-inner {
  max-width: 1700px;
  margin: 0 auto;
  padding: 20px 34px 15px;
}
.workspace-scope-heading {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}
.workspace-scope-heading h2 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
  margin: 0;
  color: var(--ink);
}
.workspace-scope-heading p {
  font-size: 12px;
  line-height: 1.6;
  color: #64738b;
  margin: 0;
}
.workspace-scope .filters {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.4fr 0.65fr 1.5fr;
  gap: 12px;
  margin: 0;
  align-items: end;
}
.workspace-scope .filters label {
  min-width: 0;
}
.workspace-scope .filters select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: #f8faff;
}
.workspace-scope .filterend {
  grid-column: 1/-1;
  order: 2;
  margin: 0;
  padding: 0 !important;
  font-size: 11px !important;
}
@media (max-width: 1200px) {
  .workspace-scope .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 1000px) {
  .workspace-scope-inner {
    padding: 18px 22px 15px;
  }
  .workspace-scope .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .workspace-scope-inner {
    padding: 16px 18px;
  }
  .workspace-scope-heading {
    gap: 4px;
    margin-bottom: 12px;
  }
  .workspace-scope-heading p {
    font-size: 11px;
  }
  .workspace-scope .filters {
    gap: 12px 10px;
  }
  .workspace-scope .filters label:last-child {
    grid-column: 1/-1;
  }
  .workspace-scope .filters select {
    font-size: 12px;
  }
}
@media (max-width: 380px) {
  .workspace-scope .filters {
    grid-template-columns: minmax(0, 1fr);
  }
}

.scope-field {
  min-width: 0;
}
.scope-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 5px;
}
.scope-select {
  position: relative;
  margin: 0;
}
.scope-select summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  min-height: 40px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faff;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.scope-select summary::-webkit-details-marker {
  display: none;
}
.scope-select summary > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scope-select summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.scope-select[open] summary {
  border-color: #7896ef;
}
.scope-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 100%;
  width: max-content;
  max-width: min(380px, calc(100vw - 36px));
  max-height: min(430px, 70vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 10px 28px #24385b24;
}
.scope-select:not([open]) > .scope-popover {
  display: none;
}
.scope-options {
  min-height: 0;
  max-height: 300px;
  overflow: auto;
  flex: 1;
}
.workspace-scope .scope-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 9px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  white-space: normal;
  line-height: 1.5;
}
.scope-options label:hover {
  background: #f1f5ff;
}
.scope-options input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.scope-all {
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.scope-field:last-of-type .scope-popover {
  left: auto;
  right: 0;
}
.scope-section-title {
  font-size: 17px;
  margin: 0 0 15px;
}
.scope-currency,
.scope-day {
  margin-bottom: 28px;
}
.workspace-scope .filterend {
  line-height: 1.6;
}
@media (max-width: 650px) {
  .scope-popover {
    max-width: calc(100vw - 36px);
    width: 100%;
    min-width: 0;
  }
  .workspace-scope .scope-field:last-of-type {
    grid-column: 1/-1;
  }
  .scope-options input {
    min-height: 16px;
  }
  .scope-select summary {
    min-height: 44px;
  }
}

.deferred-label {
  font-size: 9px;
  color: #8792a6;
  margin-left: auto;
  border: 1px solid #e1e6ee;
  border-radius: 4px;
  padding: 2px 4px;
}

.position-netting-hint {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #c7d8f9;
  border-radius: 9px;
  background: #f0f5ff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 190px;
  white-space: normal;
  color: #24519b;
}
.position-netting-hint strong {
  font-size: 12px;
}
.position-netting-hint span {
  font-size: 12px;
  line-height: 1.5;
}
.position-netting-hint button {
  align-self: flex-start;
  background: #fff;
}
.position-context {
  white-space: normal;
  min-width: 220px;
  max-width: 290px;
}
.position-context .position-contract {
  margin-top: 10px;
  font-weight: 600;
}
.position-context .subcell {
  white-space: normal;
  overflow-wrap: anywhere;
}
.configuration-section {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.configuration-section > summary {
  padding: 18px 22px;
  font-weight: 650;
  color: var(--ink);
  margin: 0;
}
.configuration-section[open] > summary {
  border-bottom: 1px solid var(--line);
}
.configuration-section-body {
  padding: 0 16px 16px;
}
.configuration-section-body > .panel {
  margin: 16px 0 0;
}
.configuration-section-body > .alertline {
  margin-top: 16px;
}
.legal-entity-tabs {
  display: flex;
  gap: 8px;
  padding: 18px 0 12px;
  flex-wrap: wrap;
}
.legal-entity-tabs [aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.legal-entity-actions {
  padding: 8px 0 18px;
}

.server-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.server-pagination .actionsline {
  margin: 0;
}

.scope-remote-search {
  padding: 8px 10px;
}
.scope-remote-search input {
  width: 100%;
  min-width: 0;
}
.scope-popover > [data-server-lookup-more] {
  margin: 8px 10px;
}
.server-search {
  display: block;
  max-width: 440px;
  margin: 16px 0;
}
.server-search input {
  width: 100%;
}
.workspace-scope[hidden] {
  display: none !important;
}
.partner-desktop {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.partner-tile {
  display: flex;
  min-height: 224px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 26px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: center;
  color: var(--ink);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.partner-tile:hover,
.partner-tile:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 5px 20px #244b8d0c;
}
.partner-logo {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: var(--partner-color);
  background: color-mix(in srgb, var(--partner-color) 9%, white);
  border: 1px solid color-mix(in srgb, var(--partner-color) 20%, white);
  font-size: 25px;
  font-weight: 750;
}
.partner-tile > strong {
  font-size: 16px;
  line-height: 1.4;
}
.partner-tile > span:not(.partner-logo) {
  font-size: 12px;
  color: var(--muted);
}
.partner-tile .partner-tile-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
}
.partner-tile-link svg {
  width: 14px;
  height: 14px;
}
.workspace-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 16px 0 24px;
}
.workspace-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 420px;
  flex: 1;
  margin: 12px 0;
}
.workspace-search > span {
  font-size: 12px;
  color: var(--muted);
}
.workspace-search input {
  width: 100%;
  min-width: 0;
}
.workspace-toolbar > .workspace-search {
  margin: 0;
}
.partner-tabs {
  display: flex;
  gap: 4px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  margin: 12px 0 26px;
  padding-bottom: 1px;
  scrollbar-width: thin;
}
.partner-tabs button {
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 14px 16px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}
.partner-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 650;
}
.partner-back {
  margin-bottom: 6px;
}
.partner-overview-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
}
.partner-overview-card h2 {
  margin: 0 0 8px;
}
.partner-overview-card p {
  margin: 0 0 6px;
  color: var(--muted);
}
.partner-overview-card code {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.partner-overview-card > .tag {
  margin-left: auto;
  white-space: nowrap;
}
.partner-overview-mark {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #edf2ff;
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
}
.partner-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 20px 0 24px;
}
.partner-summary-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
}
.partner-summary-item strong {
  font-size: 30px;
  line-height: 1;
}
.partner-summary-item span {
  font-size: 13px;
  color: var(--muted);
}
.partner-summary-item span:last-child {
  color: var(--accent);
}
.partner-upload-zone {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px;
  background: #fff;
  border: 1px dashed #c0cbe2;
  border-radius: 14px;
  margin: 20px 0 24px;
}
.partner-upload-zone h2 {
  margin: 0 0 8px;
  font-size: 19px;
}
.partner-upload-zone p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.5;
}
.partner-upload-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  background: #eef2ff;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
}
.partner-upload-icon svg {
  width: 26px;
  height: 26px;
}
.file-upload-button {
  position: relative;
  display: block;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
  border-radius: 9px;
  padding: 13px 20px;
  cursor: pointer;
  margin-left: auto;
  overflow: hidden;
  font-weight: 600;
  font-size: 14px;
}
.file-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.file-upload-button:focus-within {
  outline: 3px solid #8da4ff;
  outline-offset: 3px;
}
.file-upload-button.disabled {
  opacity: 0.6;
  cursor: progress;
}
.partner-file-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  max-width: 440px;
  overflow-wrap: anywhere;
}
.partner-file-name svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--muted);
}
.workspace-empty {
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
}
.workspace-empty > svg {
  width: 34px;
  height: 34px;
  opacity: 0.5;
  margin-bottom: 10px;
}
.workspace-empty h3 {
  color: var(--ink);
  font-size: 17px;
  margin: 8px 0;
}
.workspace-empty p {
  margin: 8px 0;
  font-size: 14px;
}
@media (max-width: 900px) {
  .partner-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .partner-upload-zone {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .file-upload-button {
    margin-left: 72px;
  }
  .partner-overview-card {
    flex-wrap: wrap;
  }
  .partner-overview-card > .tag {
    margin-left: 88px;
  }
}
@media (max-width: 540px) {
  .partner-desktop {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .partner-tile {
    min-height: 200px;
    padding: 18px 10px;
  }
  .partner-tile > strong {
    font-size: 14px;
  }
  .partner-logo {
    width: 58px;
    height: 58px;
    font-size: 22px;
  }
  .partner-tabs button {
    padding: 12px;
  }
  .partner-summary-grid {
    gap: 10px;
  }
  .partner-summary-item {
    padding: 16px;
  }
  .workspace-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .workspace-search {
    max-width: none;
    width: 100%;
  }
  .partner-upload-zone {
    padding: 20px;
    gap: 14px;
  }
  .partner-upload-icon {
    display: none;
  }
  .file-upload-button {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
  .partner-overview-card {
    padding: 20px;
    gap: 14px;
  }
  .partner-overview-card > .tag {
    margin-left: 0;
  }
  .partner-overview-mark {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }
}
/* Partner operating information and management workspace. */
.business-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 440px;
}
.business-overview {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}
.business-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.business-form label {
  min-width: 0;
}
.business-form select,
.business-form input {
  max-width: 100%;
}
.business-archive {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0;
}
.business-archive input {
  width: auto;
}
.business-number {
  white-space: nowrap;
}
.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 20px 0;
}
.calendar-toolbar input {
  width: 130px;
}
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 20px 0;
}
.calendar-key {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid #dce3ef;
}
.working-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  background: white;
  border: 1px solid #dce3ef;
  border-radius: 16px;
  padding: 16px;
}
.calendar-weekday {
  text-align: center;
  padding: 8px;
}
.calendar-day {
  min-height: 112px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  border: 1px solid #dce3ef;
  min-width: 0;
}
.calendar-day strong {
  font-size: 22px;
}
.calendar-day span {
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.calendar-day:hover {
  outline: 2px solid #4568db;
}
.calendar-day.workday,
.calendar-key.workday {
  background: #fff;
}
.calendar-day.weekend,
.calendar-key.weekend {
  background: #f1f4f9;
}
.calendar-day.holiday,
.calendar-key.holiday {
  background: #fff0f0;
  color: #ad3548;
}
.calendar-day.shortened,
.calendar-key.shortened {
  background: #fff6df;
  color: #886220;
}
@media (max-width: 700px) {
  .business-form-grid {
    grid-template-columns: 1fr;
  }
  .working-calendar {
    gap: 4px;
    padding: 8px;
  }
  .calendar-day {
    min-height: 48px;
    padding: 6px;
    align-items: center;
    justify-content: center;
  }
  .calendar-day span {
    display: none;
  }
  .calendar-day strong {
    font-size: 16px;
  }
  .calendar-toolbar {
    gap: 8px;
  }
  .calendar-toolbar label {
    max-width: 100%;
  }
}
.business-form-grid label {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.business-form .business-archive {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.business-archive input[type="checkbox"] {
  min-height: 0;
  margin: 0;
}
@media (min-width: 900px) {
  .partner-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}
.partner-reminders {
  background: #fff8e8;
  border: 1px solid #ead49d;
  border-left: 5px solid #d49a2c;
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 24px;
}
.partner-reminders-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.partner-reminders-heading h2 {
  color: #6f4c13;
  font-size: 18px;
}
.partner-reminders-heading p {
  color: #8a7041;
  margin-top: 5px;
  font-size: 13px;
}
.partner-reminders-heading button {
  flex-shrink: 0;
  border-color: #ddc591;
  color: #72521d;
  background: #fffcf4;
}
.partner-reminder-list {
  display: grid;
  gap: 12px;
}
.partner-reminder {
  background: #fffdf7;
  border: 1px solid #f0dfb8;
  border-radius: 8px;
  padding: 16px 18px;
}
.partner-reminder h3 {
  font-size: 15px;
  color: #634716;
  margin-bottom: 6px;
}
.partner-reminder p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #4f4430;
  font-size: 14px;
  line-height: 1.65;
}
.partner-reminder-author {
  color: #8a795b;
  font-size: 11px;
  margin-top: 9px;
}
.partner-reminder-empty,
.partner-reminder-more {
  color: #8a7041;
  font-size: 13px;
}
.partner-reminder-more {
  margin-top: 12px;
}
@media (max-width: 700px) {
  .partner-reminders {
    padding: 18px 16px;
  }
  .partner-reminders-heading {
    flex-direction: column;
    gap: 12px;
  }
  .partner-reminder {
    padding: 14px;
  }
  .partner-reminders-heading h2 {
    font-size: 17px;
  }
}
.forecast-intro {
  background: #eef3ff;
  border: 1px solid #d7e2ff;
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 22px;
}
.forecast-intro strong {
  font-size: 22px;
  color: #17315a;
}
.forecast-intro p {
  margin: 8px 0 0;
  color: #506588;
}
.forecast-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  gap: 14px;
  align-items: end;
}
.forecast-controls label {
  margin: 0;
}
.forecast-accounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 24px 0 16px;
}
.forecast-account {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: white;
  border: 1px solid #dce4f0;
  text-align: left;
  border-radius: 12px;
  min-width: 0;
  font-weight: 400;
  color: #19304d;
}
.forecast-account.selected {
  border-color: #4163ea;
  box-shadow: 0 0 0 2px #e1e8ff;
}
.forecast-account-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}
.forecast-account-label {
  color: #70819c;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.forecast-account .pill {
  align-self: start;
  white-space: normal;
}
.forecast-account-money {
  font-size: 21px;
  font-weight: 700;
}
.forecast-detail {
  margin-top: 24px;
}
.forecast-detail .panelhead {
  flex-wrap: wrap;
  gap: 16px;
}
.forecast-insight {
  font-size: 21px;
  margin: 0 0 22px;
  line-height: 1.4;
}
.forecast-insight.bad {
  color: #b93842;
}
.forecast-insight.warn {
  color: #98621b;
}
.forecast-insight.ok {
  color: #227c69;
}
.forecast-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.forecast-metrics strong {
  display: block;
  font-size: 19px;
  margin-top: 6px;
}
.forecast-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 25px 0 12px;
  font-size: 13px;
}
.forecast-key::before {
  content: "";
  display: inline-block;
  width: 22px;
  border-top: 3px solid #4163ea;
  margin: 0 7px 3px 0;
}
.forecast-key.stress::before {
  border-top: 3px dashed #b87512;
}
.forecast-key.reserve::before {
  border-top: 1px dashed #6d7c95;
}
.forecast-chart {
  width: 100%;
  min-height: 200px;
}
.forecast-chart svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.forecast-chart text {
  fill: #62738e;
  font-family: inherit;
  font-size: 12px;
}
.forecast-grid {
  stroke: #e8edf5;
  stroke-width: 1;
}
.forecast-zero {
  stroke: #bc7d83;
  stroke-width: 1;
}
.forecast-reserve {
  stroke: #6d7c95;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.forecast-line-base {
  fill: none;
  stroke: #4163ea;
  stroke-width: 2.5;
}
.forecast-line-stress {
  fill: none;
  stroke: #b87512;
  stroke-width: 2;
  stroke-dasharray: 6 4;
}
.forecast-cursor {
  stroke: #b6c6e9;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.forecast-day-control {
  margin: 8px 0 12px;
}
.forecast-day-control input {
  padding: 0;
  border: 0;
  height: 26px;
  width: 100%;
}
#liquidity-day-summary {
  display: flex;
  gap: 10px 24px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: #f6f8fc;
  border-radius: 8px;
  font-size: 14px;
}
.forecast-totals {
  display: flex;
  gap: 16px 30px;
  flex-wrap: wrap;
  margin: 22px 0;
}
.forecast-empty {
  padding: 28px 18px;
  background: #f6f8fc;
  border: 1px dashed #c5d2e6;
  border-radius: 12px;
  margin: 18px 0;
}
.forecast-table {
  margin: 22px 0;
  overflow: hidden;
}
.forecast-table summary,
.forecast-method summary {
  cursor: pointer;
  font-weight: 600;
  padding: 16px 0;
}
.forecast-method {
  margin-top: 22px;
}
.forecast-account:focus-visible {
  outline: 3px solid #4163ea;
  outline-offset: 3px;
}
@media (max-width: 1100px) {
  .forecast-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .forecast-controls button {
    justify-self: start;
  }
  .forecast-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .forecast-intro {
    padding: 16px;
  }
  .forecast-intro strong {
    font-size: 19px;
  }
  .forecast-controls {
    grid-template-columns: 1fr;
  }
  .forecast-account {
    padding: 16px;
  }
  .forecast-detail .panelbody {
    padding: 16px;
  }
  .forecast-metrics {
    gap: 15px 8px;
  }
  .forecast-metrics strong {
    font-size: 16px;
  }
  .forecast-insight {
    font-size: 18px;
  }
  .forecast-legend {
    gap: 10px;
  }
  #liquidity-day-summary {
    flex-direction: column;
  }
}

.bank-pair {
  border: 1px solid var(--border, #dce3ef);
  border-radius: 12px;
  padding: 16px;
  margin: 18px 0;
  min-width: 0;
}
.bank-pair legend {
  padding: 0 8px;
  font-weight: 700;
}
.bank-pair select {
  width: 100%;
  max-width: 100%;
}
.bank-pair .help {
  margin-top: 0;
}
.forecast-account-label {
  overflow-wrap: anywhere;
}

.pattern-section {
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid #dce3ef;
}
.pattern-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pattern-key::before {
  content: "";
  display: inline-block;
  width: 24px;
  border-top: 3px solid #16806c;
}
.pattern-key.future::before {
  border-top: 3px dashed #7950b7;
}
.pattern-line-history {
  stroke: #16806c;
  stroke-width: 2.5;
  fill: none;
}
.pattern-line-future {
  stroke: #7950b7;
  stroke-width: 2.5;
  stroke-dasharray: 7 5;
  fill: none;
}
.pattern-section details {
  margin-top: 16px;
}

.comparison-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #dce3ef;
}
.comparison-outcome {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 14px 0;
}
.comparison-section .forecast-legend {
  gap: 12px 20px;
}
.pattern-section {
  margin-top: 24px;
}

.forecast-chart {
  position: relative;
}
.forecast-tooltip {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  width: max-content;
  max-width: min(340px, calc(100% - 16px));
  padding: 12px 14px;
  border: 1px solid #d6deed;
  border-radius: 10px;
  background: #fff;
  color: #18283f;
  box-shadow: 0 6px 24px #18283f25;
  font-size: 13px;
}
.forecast-tooltip[hidden] {
  display: none;
}
.forecast-tooltip > b {
  display: block;
  margin-bottom: 8px;
}
.tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.tooltip-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tooltip-row small {
  color: #667892;
}
.tooltip-difference {
  border-top: 1px solid #e4e9f2;
  padding-top: 7px;
  margin-top: 9px;
}
.forecast-hover-line {
  stroke: #526782;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}
.forecast-hover-markers {
  pointer-events: none;
}
.forecast-chart svg:focus-visible {
  outline: 2px solid #4163ea;
  outline-offset: 3px;
  border-radius: 4px;
}
.chart-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Payment planning: visible decisions first, optional analytics below. */
.forecast-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.forecast-controls label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.forecast-account .help {
  margin: 0;
}
.funding-overview .forecast-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.funding-overview .forecast-metrics > div {
  border: 1px solid #dce4f0;
  border-radius: 10px;
  background: #f8faff;
}
.funding-needed {
  background: #fff8e8;
}
@media (max-width: 1100px) {
  .forecast-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .forecast-controls,
  .funding-overview .forecast-metrics {
    grid-template-columns: 1fr;
  }
}

.forecast-accounts {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
@media (max-width: 600px) {
  .forecast-accounts {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 3px;
  }
  .forecast-account {
    flex: 0 0 85%;
    scroll-snap-align: start;
  }
}

.forecast-demo {
  font-size: 14px;
  color: #19304d;
  padding: 18px;
  border-color: #cdd9ff;
  background: #f2f5ff;
}
.forecast-demo .help {
  margin-bottom: 0;
}

.cash-reason {
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}
#daily-date {
  flex-wrap: wrap;
  margin-bottom: 16px;
}
#daily-date label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
