.pqCalcBtn {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pqCalcBtn:hover {
  background: rgba(255,255,255,.13);
}

.pqBlisterGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr);
  gap: 10px;
  align-items: start;
}

.pqBlisterPart,
.pqBlisterPaper {
  margin: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 9px;
  background: rgba(3,5,12,.22);
}

.pqBlisterPart.isDisabled { opacity: .5; }

.pqBlisterForm { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.pqBlisterToggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,.87);
  font-size: 12px;
  font-weight: 800;
}

.pqBlisterToggle input { accent-color: oklch(.62 .22 20); }
.pqBlisterWide { grid-column: span 2; }

.pqBlisterRun {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 7px;
  background: rgba(255,255,255,.035);
}

.pqBlisterRun strong { font-size: 12px; }
.pqBlisterRun span, .pqBlisterRun small { color: rgba(255,255,255,.58); font-size: 11px; }
.pqBlisterSummary { position: sticky; top: 0; }
.pqBlisterUnit { margin-top: -3px; background: rgba(255,255,255,.045); }

@media (max-width: 900px) {
  .pqBlisterGrid { grid-template-columns: 1fr; }
  .pqBlisterSummary { position: static; }
}

@media (max-width: 620px) {
  .pqBlisterForm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pqBlisterWide { grid-column: span 2; }
}

.pqCalcOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(5, 7, 16, .74);
}

.pqCalcOverlay.isOpen {
  display: flex;
}

.pqCalcModal {
  width: min(1320px, 98vw);
  max-height: calc(100vh - 28px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  background: oklch(0.16 0.018 265);
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
  color: rgba(255,255,255,.92);
}

.pqCalcHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: oklch(0.2 0.022 265);
}

.pqCalcTitle {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.pqCalcSub {
  margin-top: 3px;
  color: rgba(255,255,255,.58);
  font-size: 12px;
}

.pqCalcClose,
.pqCalcPrimary,
.pqCalcGhost {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pqCalcClose,
.pqCalcGhost {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.88);
}

.pqCalcPrimary {
  background: oklch(0.62 0.22 20);
  color: oklch(0.98 0.004 20);
}

.pqCalcBody {
  max-height: calc(100vh - 95px);
  overflow: auto;
  padding: 12px;
}

.pqCalcTabs {
  display: inline-flex;
  gap: 6px;
  padding: 3px;
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
}

.pqCalcTab {
  min-height: 28px;
  padding: 5px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255,255,255,.68);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pqCalcTab.isActive {
  background: rgba(255,255,255,.14);
  color: rgba(255,255,255,.95);
}

.pqCalcGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
  gap: 10px;
  align-items: start;
}

.pqCalcPanel {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  overflow: hidden;
}

.pqCalcPanelHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.pqCalcForm {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.pqCalcProjectBar {
  display: grid;
  grid-template-columns: minmax(200px, 1.3fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
}

.pqCalcProjectBar .pqCalcPrimary {
  min-height: 34px;
  white-space: nowrap;
}

.pqSheetPlans {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.pqSheetTabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pqSheetTab {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px;
  background: rgba(255,255,255,.025);
  color: rgba(255,255,255,.68);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pqSheetTab:hover,
.pqSheetTab.isActive {
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.94);
}

.pqSheetTab small {
  margin-left: 4px;
  color: inherit;
  opacity: .68;
  font-weight: 700;
}

.pqSheetPlan {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 9px;
  background: rgba(3,5,12,.24);
}

.pqSheetPlanHead {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
}

.pqSheetPlanActions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.pqSheetPlanHead strong {
  color: rgba(255,255,255,.92);
  font-size: 12px;
}

.pqSheetPlanHead span,
.pqSheetPlanMeta {
  color: rgba(255,255,255,.56);
  font-size: 11px;
}

.pqSheetPlanForm {
  padding: 10px;
}

.pqSheetPlanMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  padding: 0 10px 10px;
}

.pqSheetPlanMeta strong {
  color: oklch(0.86 0.07 150);
  font-weight: 800;
}

.pqCalcSheetSummary {
  display: grid;
  gap: 5px;
  padding-top: 3px;
}

.pqCalcSheetSummaryRow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: baseline;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  background: rgba(255,255,255,.035);
}

.pqSavedList {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.pqSavedRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.03);
}

.pqSavedRow strong,
.pqSavedRow small {
  display: block;
}

.pqSavedRow strong { font-size: 13px; }
.pqSavedRow small { margin-top: 3px; color: rgba(255,255,255,.55); font-size: 11px; }

.pqSavedActions { display: inline-flex; align-items: center; gap: 6px; }

.pqCalcSheetSummaryRow strong,
.pqCalcSheetSummaryRow b {
  color: rgba(255,255,255,.9);
  font-size: 11px;
}

.pqCalcSheetSummaryRow span {
  overflow: hidden;
  color: rgba(255,255,255,.68);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pqCalcSheetSummaryRow small {
  grid-column: 1 / -1;
  color: rgba(255,255,255,.48);
  font-size: 10px;
}

.pqCalcField {
  display: grid;
  gap: 4px;
}

.pqCalcField.w2 { grid-column: span 2; }
.pqCalcField.w3 { grid-column: span 3; }
.pqCalcField.w4 { grid-column: span 4; }
.pqCalcField.w6 { grid-column: span 6; }

.pqCalcField span {
  color: rgba(255,255,255,.56);
  font-size: 11px;
  font-weight: 800;
}

.pqCalcField input,
.pqCalcField select {
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 7px;
  background: rgba(3,5,12,.52);
  color: rgba(255,255,255,.92);
  font-size: 12px;
  outline: none;
}

.pqCalcField input:focus,
.pqCalcField select:focus {
  border-color: rgba(229,9,81,.65);
  box-shadow: 0 0 0 3px rgba(229,9,81,.16);
}

.pqCalcProcesses,
.pqCalcSettingsList {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.pqCalcProcessRow,
.pqCalcRateRow {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 100px 46px 90px 30px;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(255,255,255,.045);
}

.pqCalcRateRow {
  grid-template-columns: minmax(220px, 1fr) 120px;
}

.pqCalcProcessRow:nth-child(even),
.pqCalcRateRow:nth-child(even) {
  background: rgba(255,255,255,.07);
}

.pqCalcProcessRow strong,
.pqCalcRateRow strong {
  font-size: 12px;
  font-weight: 800;
}

.pqCalcProcessRow small,
.pqCalcRateRow small {
  color: rgba(255,255,255,.52);
  font-size: 11px;
}

.pqFormulaBadge,
.pqManualBadge,
.pqCalcRateRow span {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0;
  vertical-align: 1px;
}

.pqFormulaBadge,
.pqCalcRateRow span {
  border: 1px solid oklch(0.66 0.15 150 / .34);
  background: oklch(0.24 0.05 150 / .64);
  color: oklch(0.88 0.08 150);
}

.pqManualBadge {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.64);
}

.pqCalcProcessRow input,
.pqCalcRateRow input {
  width: 100%;
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  background: rgba(3,5,12,.46);
  color: rgba(255,255,255,.9);
  font-size: 12px;
}

.pqCalcProcessRow input[readonly] {
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.62);
}

.pqCalcEmpty {
  padding: 12px;
  border: 1px dashed rgba(255,255,255,.16);
  border-radius: 8px;
  color: rgba(255,255,255,.58);
  font-size: 12px;
}

.pqCalcIconBtn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.78);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.pqCalcIconBtn:hover {
  background: rgba(229,9,81,.22);
  border-color: rgba(229,9,81,.38);
}

.pqProcessPicker {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5,7,16,.52);
}

.pqProcessPickerPanel {
  width: min(680px, 96vw);
  max-height: min(720px, 86vh);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: oklch(0.17 0.018 265);
  box-shadow: 0 22px 60px rgba(0,0,0,.45);
}

.pqProcessPickerHead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.pqProcessPickerHead strong,
.pqProcessPickerHead span {
  display: block;
}

.pqProcessPickerHead strong {
  font-size: 14px;
}

.pqProcessPickerHead span {
  margin-top: 2px;
  color: rgba(255,255,255,.58);
  font-size: 12px;
}

.pqProcessPickerList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: calc(86vh - 82px);
  overflow: auto;
  padding: 10px;
}

.pqProcessChoice {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.88);
  text-align: left;
  cursor: pointer;
}

.pqProcessChoice:hover {
  background: rgba(255,255,255,.08);
}

.pqProcessChoice.isSelected {
  border-color: oklch(0.62 0.22 20 / .65);
  background: oklch(0.26 0.08 20 / .55);
}

.pqProcessChoice span {
  font-size: 12px;
  font-weight: 800;
}

.pqProcessChoice small {
  color: rgba(255,255,255,.58);
  font-size: 11px;
  white-space: nowrap;
}

.pqCalcSummary {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.pqCalcTotal {
  padding: 13px 12px;
  border-radius: 10px;
  background: oklch(0.26 0.07 150 / .6);
  border: 1px solid oklch(0.55 0.12 150 / .45);
}

.pqCalcTotal span {
  display: block;
  color: rgba(255,255,255,.58);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.pqCalcTotal strong {
  display: block;
  margin-top: 3px;
  font-size: 28px;
  line-height: 1;
}

.pqCalcLine {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
}

.pqCalcLine span {
  color: rgba(255,255,255,.6);
}

.pqCalcLine strong {
  color: rgba(255,255,255,.92);
}

.pqCalcHint {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,.055);
  color: rgba(255,255,255,.62);
  font-size: 12px;
}

.pqCalcSettingHint {
  grid-column: span 4;
  align-self: end;
}

.pqCalcSheetPreview {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 0 2px;
}

.pqCalcSheetLabel {
  color: rgba(25,31,42,.7);
  font-size: 12px;
  font-weight: 800;
  justify-self: stretch;
}

.pqCalcSheet {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  border: 1px solid rgba(24,31,42,.18);
  border-radius: 6px;
  background:
    linear-gradient(rgba(24,31,42,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24,31,42,.055) 1px, transparent 1px),
    oklch(0.985 0.004 255);
  background-size: 20px 20px;
}

.pqCalcSheet i {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid rgba(74,85,104,.32);
  background: rgba(148,163,184,.22);
}

.pqCalcSheet i b {
  position: absolute;
  box-sizing: border-box;
  border: 1px dashed rgba(74,85,104,.74);
  background: rgba(148,163,184,.36);
}

.pqCalcBottomMargin {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  border-top: 1px solid rgba(185, 104, 42, .7);
  background: rgba(185, 104, 42, .1);
  pointer-events: none;
}

.pqCalcHidden {
  display: none;
}

@media (max-width: 980px) {
  .pqCalcGrid,
  .pqCalcForm {
    grid-template-columns: 1fr;
  }
  .pqCalcField,
  .pqCalcField.w2,
  .pqCalcField.w3,
  .pqCalcField.w4,
  .pqCalcField.w6 {
    grid-column: auto;
  }
  .pqCalcSettingHint { grid-column: auto; }
  .pqCalcProjectBar { grid-template-columns: 1fr; }
  .pqCalcProcessRow {
    grid-template-columns: minmax(140px, 1fr) 74px 38px 78px 30px;
  }
  .pqProcessPickerList {
    grid-template-columns: 1fr;
  }
}
