.summary-section .summary-header {
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e0e0e0;
}

.summary-close-btn {
  display: none;
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #888888;
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px -4px 0;
  border-radius: 6px;
  flex-shrink: 0;
}

.summary-close-btn:hover {
  color: #e5322d;
  background: #fff5f5;
}

.summary-section.expanded .summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 3px solid #e5322d;
}

.summary-section.expanded .summary-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.summary-section.expanded {
  position: fixed;
  top: var(--topbar-height, 64px);
  right: 0;
  width: min(800px, 100vw);
  height: calc(100vh - var(--topbar-height, 64px));
  margin: 0;
  padding: 20px;
  border-radius: 0;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  overflow-y: auto;
  overflow-x: hidden;
  background: #ffffff;
}

.summary-section.expanded .summary-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #212529;
  letter-spacing: 0.5px;
}

.summary-section.expanded .summary-box-compact {
  display: none;
}

.summary-section .summary-header h3 {
  margin: 0;
}

.summary-expanded-content {
  display: none;
  padding-top: 4px;
}

.summary-section.expanded .summary-expanded-content {
  display: block;
}

.summary-expanded-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.summary-expanded-header h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 700;
  color: #212529;
}

.summary-subtitle {
  margin: 0;
  font-size: 11px;
  color: #6c757d;
}

.summary-expanded-status {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff5f5;
  border: 1px solid #f1c4c2;
  color: #b02a1f;
  font-size: 12px;
  line-height: 1.4;
}

.summary-expanded-status[hidden] {
  display: none !important;
}

.summary-table-container {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.summary-table-container::before {
  content: attr(data-title);
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #212529;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0e0e0;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.summary-table thead th {
  padding: 6px 4px;
  text-align: left;
  font-weight: 600;
  font-size: 9px;
  color: #6c757d;
  text-transform: uppercase;
  border-bottom: 2px solid #e0e0e0;
  background: #f8f9fa;
}

.summary-table td {
  padding: 8px 4px;
  color: #495057;
  border-bottom: 1px solid #eceff3;
  vertical-align: top;
  word-break: break-word;
}

.summary-table td.bezeichnung-multiline {
  white-space: normal;
  max-width: 400px;
  line-height: 1.6;
  font-size: 11px;
}

.summary-table--operations td.bezeichnung-multiline {
  max-width: none;
}

.summary-table td:nth-child(7) {
  text-align: right;
  font-weight: 700;
  color: #e5322d;
}

.summary-table tbody tr:last-child td {
  border-bottom: none;
}

.summary-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 8px 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  font-size: 11px;
}

.summary-subtotal-value {
  font-weight: 700;
}

.summary-price-breakdown {
  margin-bottom: 12px;
}

.summary-price-breakdown h5 {
  margin: 0 0 8px 0;
  font-size: 12px;
  font-weight: 700;
}

.summary-totals {
  display: grid;
  gap: 6px;
}

.summary-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.summary-grand-total {
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #333333 0%, #2a2a2a 100%);
  border-radius: 8px;
  text-align: center;
  color: #ffffff;
}

.grand-total-label {
  font-size: 10px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.grand-total-value {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.summary-expanded-content .summary-item-highlight {
  display: none;
}

.summary-table--operations td:nth-child(4) {
  font-size: 10px;
  line-height: 1.35;
}

#summary-stone {
  font-size: clamp(8px, 1.5vw, 10px);
  word-break: break-word;
}

.summary-delivery-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  background: #fafafa;
}

.summary-delivery-choice[hidden] {
  display: none;
}

.summary-delivery-choice-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.summary-delivery-choice-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #888;
}

.summary-delivery-choice-title {
  font-size: 14px;
  font-weight: 600;
  color: #222;
}

.summary-delivery-choice-hint {
  font-size: 12px;
  color: #666;
}

.summary-delivery-choice-btn {
  flex-shrink: 0;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #e5322d;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.summary-delivery-choice-btn:hover {
  border-color: #e5322d;
  background: #fff5f5;
}

