.pcc-panel {
  --pcc-accent: #0f766e;
  --pcc-accent-soft: #ccfbf1;
  --pcc-surface: var(--ct-surface, #fff);
  --pcc-border: var(--ct-border, #e2e8f0);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.pcc-tabs {
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.pcc-tab-content {
  padding-top: 0.25rem;
  width: 100%;
}

.pcc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}

@media (max-width: 991.98px) {
  .pcc-layout {
    grid-template-columns: 1fr;
  }
}

.pcc-input-col,
.pcc-result-col {
  min-width: 0;
  width: 100%;
}

.pcc-section {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--pcc-border);
  border-radius: 0.5rem;
  background: var(--pcc-surface);
}

.pcc-section-title {
  font-weight: 650;
  font-size: 0.9rem;
  margin-bottom: 0.55rem;
}

.pcc-mode-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.pcc-mode-btn {
  border: 1px solid var(--pcc-border);
  background: #fff;
  color: #334155;
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  border-radius: 0.375rem;
}

.pcc-mode-btn.active {
  background: var(--pcc-accent);
  border-color: var(--pcc-accent);
  color: #fff;
}

.pcc-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}

.pcc-fees-grid,
.pcc-cost-grid,
.pcc-inline-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 0.55rem 0.75rem;
  margin-top: 0.55rem;
}

.pcc-fees-grid label,
.pcc-cost-grid label,
.pcc-inline-row label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: #475569;
  margin: 0;
  min-width: 0;
}

.pcc-fees-grid input,
.pcc-cost-grid input,
.pcc-inline-row input,
.pcc-section .form-select {
  width: 100%;
  max-width: 100%;
}

.pcc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.pcc-result-card,
.pcc-compare-card {
  border: 1px solid var(--pcc-border);
  border-radius: 0.5rem;
  padding: 1rem;
  background: linear-gradient(165deg, #f0fdfa 0%, #fff 45%);
  margin-bottom: 1rem;
}

.pcc-result-title {
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #115e59;
}

.pcc-kpi-grid,
.pcc-batch-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  gap: 0.65rem;
}

.pcc-batch-summary {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--pcc-border);
}

.pcc-kpi {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--pcc-border);
  border-radius: 0.4rem;
  padding: 0.55rem 0.65rem;
  min-width: 0;
}

.pcc-kpi-accent {
  border-color: #5eead4;
  background: var(--pcc-accent-soft);
}

.pcc-kpi-label {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.pcc-kpi-value {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.pcc-formula {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: #475569;
}

.pcc-warn {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: #b91c1c;
}

.pcc-compare-table {
  margin: 0;
  font-size: 0.85rem;
  width: 100%;
}

.pcc-batch-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pcc-upload-btn {
  margin: 0;
  cursor: pointer;
}

.pcc-batch-summary-bar {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.4rem;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  font-size: 0.9rem;
  word-break: break-word;
}

.pcc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--pcc-border);
  border-radius: 0.5rem;
  width: 100%;
  max-width: 100%;
}

.pcc-batch-table {
  margin: 0;
  font-size: 0.82rem;
  width: 100%;
  min-width: 72rem;
  table-layout: auto;
}

.pcc-batch-table th,
.pcc-batch-table td {
  white-space: nowrap;
  vertical-align: middle;
  padding: 0.45rem 0.55rem;
}

.pcc-batch-table .pcc-col-name {
  white-space: normal;
  min-width: 6rem;
  max-width: 12rem;
  word-break: break-word;
}

.pcc-batch-formula-hint {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}

.pcc-empty-row td {
  text-align: center;
  color: #94a3b8;
  padding: 1.5rem !important;
  white-space: normal !important;
}

.pcc-status-loss {
  color: #b91c1c;
  font-weight: 600;
}

.pcc-status-low {
  color: #b45309;
  font-weight: 600;
}

.pcc-status-ok {
  color: #047857;
  font-weight: 600;
}

.pcc-ai-settings {
  margin-bottom: 0.85rem;
  border: 1px solid var(--pcc-border);
  border-radius: 0.5rem;
  background: #f8fafc;
}

.pcc-ai-settings summary {
  cursor: pointer;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.pcc-ai-settings-body {
  padding: 0 0.85rem 0.85rem;
}

.pcc-ai-row {
  margin-bottom: 0.5rem;
  max-width: min(28rem, 100%);
}

.pcc-ai-row .form-label {
  margin-bottom: 0.15rem;
  font-size: 0.75rem;
}

.pcc-ai-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.pcc-ai-result {
  border: 1px solid var(--pcc-border);
  border-radius: 0.5rem;
  padding: 0.85rem;
  background: #fff;
  width: 100%;
  overflow-x: auto;
}

.pcc-ai-summary {
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 0.65rem;
}

.pcc-ai-highlights {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
  font-size: 0.875rem;
  color: #334155;
}

@media (max-width: 575.98px) {
  .pcc-section {
    padding: 0.7rem 0.75rem;
  }

  .pcc-batch-table {
    font-size: 0.75rem;
    min-width: 72rem;
  }
}
