/* src/components/profitShare/profitSelectionCalculator.css */
.profit-sum-widget {
  position: fixed;
  z-index: 29;
  right: 90px;
  bottom: 28px;
  left: var(--sum-left,auto);
  top: var(--sum-top,auto);
  width: max-content;
  height: max-content;
  max-width: calc(100vw - 24px);
  color: var(--dk-text-primary,#182b36);
  font-size: 13px;
}
.profit-sum-panel {
  width: 340px;
  max-width: 100%;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border: 1px solid var(--dk-border,#dce7e5);
  border-radius: 20px;
  background: var(--dk-surface-solid,#fff);
  box-shadow: 0 16px 54px #102e3626, 0 2px 8px #102e3614;
  padding: 16px;
  animation: profit-sum-appear .22s ease-out;
}
.profit-sum-heading,
.profit-sum-title,
.profit-sum-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.profit-sum-heading {
  margin-bottom: 14px;
}
.profit-sum-title {
  flex: 1;
  font-size: 14px;
}
.profit-sum-title > svg {
  color: #10b981;
}
.profit-sum-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 0;
  border-radius: 10px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.profit-sum-icon:hover {
  background: var(--dk-surface-3,#edf4f2);
}
.profit-sum-icon:disabled {
  opacity: .3;
  cursor: default;
}
.profit-sum-widget button:focus-visible,
.profit-sum-cell:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}
.profit-sum-drag {
  cursor: grab;
  touch-action: none;
}
.profit-sum-drag:active {
  cursor: grabbing;
}
.profit-sum-result {
  border-radius: 13px;
  background:
    linear-gradient(
      120deg,
      #10b98115,
      #14b8a60a);
  padding: 12px;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.profit-sum-result > span {
  display: block;
  color: var(--dk-text-muted,#61746f);
  font-size: 11px;
}
.profit-sum-result > strong {
  display: block;
  font-size: 28px;
  line-height: 1.35;
  margin-top: 4px;
  overflow-wrap: anywhere;
  letter-spacing: -.6px;
}
.profit-sum-result strong small {
  font-size: 17px;
  font-weight: 500;
}
.profit-sum-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1;
  min-height: 38px;
  border: 1px solid #10b98166;
  border-radius: 10px;
  background: #10b98112;
  color: inherit;
  font-weight: 600;
}
.profit-sum-mode.is-active {
  background: #047857;
  color: #fff;
  border-color: #047857;
}
.profit-sum-hint {
  font-size: 11px;
  line-height: 1.55;
  color: var(--dk-text-muted,#61746f);
  margin: 10px 0 0;
}
.profit-sum-details-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 12px 0 0;
  font-size: 12px;
  font-weight: 500;
}
.profit-sum-details-toggle > span {
  margin-left: auto;
  border-radius: 8px;
  padding: 1px 7px;
  background: #10b98118;
}
.profit-sum-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  max-height: 180px;
  overflow: auto;
  overscroll-behavior: contain;
}
.profit-sum-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-top: 1px solid var(--dk-border,#e7eeec);
}
.profit-sum-list li > div {
  min-width: 0;
  flex: 1;
}
.profit-sum-list li strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
}
.profit-sum-list li small {
  color: var(--dk-text-muted,#61746f);
  font-size: 10px;
}
.profit-sum-list li > span {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.profit-sum-dock-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--dk-surface-solid,#fff);
  color: var(--dk-text-primary,#476759);
  box-shadow: 0 2px 6px #102e3614;
  transition: background .15s, color .15s;
}
.profit-sum-dock-button:hover,
.profit-sum-dock-button[aria-expanded=true] {
  background: var(--dk-surface-3,#edf4f2);
  color: #059669;
}
.profit-sum-dock-button.is-selecting {
  box-shadow: inset 0 0 0 2px #10b981;
}
.profit-sum-dock-button:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}
.profit-sum-dock-button.compact {
  width: 32px;
  height: 32px;
}
.profit-sum-dock-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  border-radius: 9px;
  background: #047857;
  color: #fff;
  font: 600 10px/17px sans-serif;
  text-align: center;
}
.profit-sum-dock-dot {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}
.profit-sum-editable {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  border-radius: 6px;
}
.profit-sum-cell {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  cursor: crosshair;
  box-shadow: inset 0 0 0 1px #10b98155;
  transition: background .15s, box-shadow .15s;
}
.profit-sum-cell-small {
  height: 28px;
  font-size: 13px;
}
.profit-sum-cell:hover {
  background: #10b98115;
}
.profit-sum-selected {
  background: #10b98124;
  box-shadow: inset 0 0 0 2px #10b981;
}
.profit-sum-cell > svg {
  position: absolute;
  top: 2px;
  left: 2px;
  color: #059669;
}
@keyframes profit-sum-appear {
  from {
    opacity: 0;
    transform: translateY(9px) scale(.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (max-width:767px) {
  .profit-sum-widget {
    left: auto;
    top: auto;
    right: 12px;
    bottom: calc(160px + env(safe-area-inset-bottom, 0px));
  }
  .profit-sum-widget.is-open {
    left: 12px;
    width: auto;
  }
  .profit-sum-panel {
    width: 100%;
    max-height: 48dvh;
    padding: 12px 14px;
    border-radius: 18px;
  }
  .profit-sum-heading {
    margin-bottom: 8px;
  }
  .profit-sum-drag {
    display: none;
  }
  .profit-sum-result {
    padding: 8px 12px;
    margin-bottom: 8px;
  }
  .profit-sum-result > strong {
    font-size: 25px;
  }
  .profit-sum-hint {
    font-size: 11px;
    margin-top: 7px;
  }
  .profit-sum-list {
    max-height: 110px;
  }
  .profit-sum-cell {
    min-height: 36px;
  }
  .profit-sum-icon {
    min-width: 38px;
    min-height: 38px;
  }
}
@media (prefers-reduced-motion:reduce) {
  .profit-sum-panel {
    animation: none;
  }
  .profit-sum-cell,
  .profit-sum-dock-button {
    transition: none;
  }
}
