/* Profit / price calculator — invoice-style chrome */

.pc-preview-wrap {
  width: min(520px, 100%);
  margin: 0 auto;
}

.pc-sheet {
  background: #fff;
  color: #171719;
  border: 1px solid #d9d8d3;
  box-shadow: 0 22px 70px rgb(0 0 0 / 18%);
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 560px;
}

.pc-sheet-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #171719;
  direction: ltr;
}

.pc-sheet-mark {
  order: 1;
  margin-right: auto;
  text-align: left;
  direction: rtl;
}

.pc-sheet-kicker {
  display: block;
  color: #e45d1a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.pc-sheet-mark strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.pc-sheet-meta {
  order: 2;
  color: #85858a;
  font-size: 12px;
  font-weight: 700;
  direction: rtl;
  text-align: left;
}

.pc-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border: 1px solid #c8c8c8;
  font-size: 10px;
  font-weight: 700;
  color: #5d5d62;
}

.pc-badge--good {
  border-color: #1f7a45;
  color: #1f7a45;
  background: #eef8f1;
}

.pc-badge--warn {
  border-color: #b45309;
  color: #b45309;
  background: #fff7ed;
}

.pc-badge--bad {
  border-color: #b42318;
  color: #b42318;
  background: #fef3f2;
}

.pc-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 0.3mm solid #c8c8c8;
  background: #f7f7f4;
}

.pc-hero-cell {
  padding: 12px 14px;
  border-left: 0.3mm solid #c8c8c8;
}

.pc-hero-cell:last-child { border-left: 0; }

.pc-hero-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #6b6b6b;
  margin-bottom: 4px;
}

.pc-hero-value {
  display: block;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  direction: ltr;
  text-align: right;
  unicode-bidi: plaintext;
}

.pc-hero-cell--accent {
  background: #171719;
  color: #fff;
}

.pc-hero-cell--accent .pc-hero-label { color: #b7b7ba; }
.pc-hero-cell--accent .pc-hero-value { color: #fff; }

.pc-section-title {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 800;
}

.pc-lines {
  border: 0.3mm solid #c8c8c8;
}

.pc-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 0.3mm solid #c8c8c8;
  font-size: 12px;
  font-weight: 600;
}

.pc-line:last-child { border-bottom: 0; }

.pc-line span:last-child {
  direction: ltr;
  unicode-bidi: plaintext;
  font-weight: 700;
  white-space: nowrap;
}

.pc-line--muted { color: #6b6b6b; font-weight: 500; }
.pc-line--total {
  background: #171719;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.pc-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  color: #6b6b6b;
}

.pc-sheet-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding-top: 12px;
  border-top: 0.3mm solid #c8c8c8;
  color: #85858a;
  font-size: 11px;
  font-weight: 600;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.preset-btn {
  appearance: none;
  border: 1px solid var(--ui-border-strong);
  background: transparent;
  color: var(--ui-muted);
  min-height: 36px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.preset-btn:hover,
.preset-btn.is-active {
  border-color: var(--ui-accent);
  color: var(--ui-text);
  background: rgb(228 93 26 / 12%);
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-switch label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--ui-border-strong);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--ui-muted);
}

.mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-switch label:has(input:checked) {
  border-color: var(--ui-accent);
  color: var(--ui-text);
  background: rgb(228 93 26 / 12%);
}

@media (max-width: 980px) {
  .app[data-view="edit"] .preview-panel { display: none; }
  .app[data-view="preview"] .editor-panel { display: none; }
  .app[data-view="preview"] .app-body { grid-template-columns: 1fr; }
  .pc-hero { grid-template-columns: 1fr; }
  .pc-hero-cell { border-left: 0; border-bottom: 0.3mm solid #c8c8c8; }
  .pc-hero-cell:last-child { border-bottom: 0; }
}

@media print {
  .pc-sheet {
    box-shadow: none !important;
    border: 0 !important;
    min-height: 0 !important;
  }
}
