/* anPCB Panel Calculator — module styles
   © 2026 anPCB. All rights reserved.
   Unauthorized copying or redistribution is prohibited without written permission. */

.pnl-tool {
  --pnl-blue: #0f4c81;  --pnl-navy: #14356b;  --pnl-ink: #33475c;
  --pnl-text: #43566d;
  --pnl-muted: #6b7f96;
  --pnl-line: #dbe6f0;
  --pnl-line-soft: #edf3fa;
  --pnl-soft: #f1f6fc;
  --pnl-amber: #c05621;
  --pnl-amber-line: #e3be97;
  --pnl-amber-bg: #fdf6ec;
  --pnl-red: #b42318;
  --pnl-red-bg: #fdf2f2;
  --pnl-red-line: #f3c6c2;
  font-size: 14px;
  color: var(--pnl-text);
}

.pnl-tool [hidden] { display: none !important; }

.pnl-grid {
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
  gap: 20px;
  align-items: stretch;
}

/* Both boxes share one row, so their top and bottom edges line up. */
.pnl-controls { height: 100%; }

.pnl-grid > * { min-width: 0; }

.pnl-panel {
  background: #fff;
  border: 1px solid var(--pnl-line);
  border-radius: 12px;
  padding: 22px;
}

.pnl-controls {
  box-shadow: 0 10px 28px -24px rgba(13, 44, 84, .28);
}

/* Conclusions sit under the inputs, inside the same left box. */
.pnl-outcome {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--pnl-line);
}

/* Right box: diagram only, scaled up to the space the box provides. */
.pnl-diagram-card {
  display: flex;
  align-items: center;
  padding: 10px;
  background: linear-gradient(180deg, #f8fbfe 0%, #ffffff 100%);
}

.pnl-diagram-card .pnl-diagram {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 0;
  background: transparent;
}

.pnl-diagram-card .pnl-diagram svg {
  width: 100%;
  height: auto;
  max-height: none;
}

/* Phones keep the overall sizes only: the strip and board labels would be
   too small to read at this width. The live render omits them as well. */
@media (max-width: 480px) {
  .pnl-diagram svg .pnl-a-part,
  .pnl-diagram svg .pnl-a-rail { display: none; }
}
/* Top bar: shared units switch above the single form. */

.pnl-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding-top: 18px;
  padding-bottom: 12px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--pnl-line);
}

/* Guests only get the units switch: the internal module switch is not rendered. */
.pnl-topbar--units-only { justify-content: flex-end; }

/* Units and the internal module switch share the left end of the top row. */
.pnl-topbar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}

/* Print / Download PDF — the site primary button treatment. */
.pnl-print-btn {
  margin-left: auto;
  padding: 13px 20px;
  border: 0;
  border-radius: 6px;
  background: #0f4c81;
  color: #ffffff;
  font-family: Arimo, Arial, Helvetica, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.pnl-print-btn:hover,
.pnl-print-btn:focus-visible { background: #14356b; }

@media (max-width: 767px) {
  .pnl-print-btn { width: 100%; margin-left: 0; }
}

.pnl-topbar-text strong {
  display: block;
  font-size: 13px;
  color: #2a4767;
}

.pnl-topbar-text span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: #8a9bb0;
}

.pnl-units {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pnl-units .pnl-label { margin-bottom: 0; white-space: nowrap; }

.pnl-units .pnl-seg { min-width: 168px; }

.pnl-seg--mode { min-width: 320px; }

/* Units get their own compact row; the switch takes the full field width. */
.pnl-units-row { margin-top: 14px; }

.pnl-units-row .pnl-seg {
  width: 100%;
  height: 44px;
  padding: 3px;
  box-sizing: border-box;
}

.pnl-units-row .pnl-seg label { display: flex; }

.pnl-units-row .pnl-seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 6px;
  box-sizing: border-box;
}

.pnl-result-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pnl-result-head .pnl-status { margin-left: auto; }

/* Desktop: inputs and conclusions share the left box; the right box holds
   nothing but the diagram, scaled to its width. */
@media (min-width: 1001px) {
  .pnl-grid { grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); }
}

.pnl-result-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--pnl-navy);
}

/* Sheet-yield conclusion line: boards per sheet and utilization only. */
.pnl-y-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #5c6d82;
}

.pnl-y-summary b {
  color: var(--pnl-navy);
  font-weight: 800;
}

.pnl-group { margin-top: 14px; }
.pnl-group:first-child { margin-top: 0; }

/* Rows that sit directly in a mode body (kerf / rotation) keep their spacing. */
.pnl-mode-body > .pnl-row2 { margin-top: 14px; }

.pnl-label {
  display: block;
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #2a4767;
  font-weight: 700;
  margin-bottom: 7px;
}

.pnl-label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 10px;
  margin-bottom: 7px;
}

.pnl-label-row .pnl-label { margin-bottom: 0; }

/* The "per direction" note must not push this header onto a second line:
   keeping it out of flow lets the fields start level with the rails group. */
.pnl-group--edge .pnl-label-row {
  position: relative;
  flex-wrap: nowrap;
}

.pnl-group--edge .pnl-label-row .pnl-mini {
  position: absolute;
  top: 0;
  right: 0;
}

.pnl-mini {
  font-size: 10.5px;
  color: var(--pnl-muted);
  letter-spacing: .03em;
  white-space: nowrap;
}

.pnl-help {
  margin: 7px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: #8a9bb0;
}

.pnl-row2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pnl-row2 > .pnl-group { margin-top: 0; }

.pnl-controls > .pnl-row2 { margin-top: 14px; }

.pnl-field { display: block; min-width: 0; }

.pnl-field-label {
  display: block;
  font-size: 11.5px;
  line-height: 1.4;
  color: #3a4e66;
  font-weight: 600;
  margin-bottom: 5px;
}

.pnl-select,
.pnl-inputwrap input {
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  border: 1px solid #cfe0f1;
  border-radius: 6px;
  background: #fff;
  padding: 0 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--pnl-navy);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  -moz-appearance: textfield;
}

.pnl-inputwrap input::-webkit-outer-spin-button,
.pnl-inputwrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pnl-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #6b7f96 50%), linear-gradient(135deg, #6b7f96 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
  font-size: 14px;
}

.pnl-select:focus,
.pnl-inputwrap input:focus {
  border-color: var(--pnl-blue);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, .12);
}

.pnl-inputwrap input:disabled,
.pnl-inputwrap input[readonly] {
  background: #f5f8fb;
  color: #6b7f96;
  cursor: default;
  border-style: dashed;
}

.pnl-inputwrap {
  position: relative;
  display: block;
}

.pnl-inputwrap input { padding-right: 46px; }

.pnl-inputwrap em {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 11.5px;
  color: var(--pnl-muted);
  pointer-events: none;
}

.pnl-seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--pnl-line);
  border-radius: 6px;
  background: var(--pnl-soft);
}

.pnl-seg label {
  flex: 1 1 0;
  position: relative;
  cursor: pointer;
}

.pnl-seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pnl-seg span {
  display: block;
  text-align: center;
  padding: 10px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1.2;
  color: #5c6d82;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.pnl-seg input:checked + span {
  background: #fff;
  color: var(--pnl-blue);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(17, 48, 82, .14);
}

.pnl-seg input:focus-visible + span {
  outline: 2px solid rgba(15, 76, 129, .3);
  outline-offset: 1px;
}

.pnl-seg--units span { padding: 9px 6px; }

/* Saw kerf and rotation share one row: the number field and the segmented
   switch must read as the same object — equal width and height, matching
   border/radius, and vertically centred content. */
.pnl-row--kerf .pnl-label-row,
.pnl-row--kerf > .pnl-group > .pnl-label {
  height: 18px;
  line-height: 18px;
  margin-bottom: 7px;
}

.pnl-row--kerf .pnl-inputwrap input,
.pnl-row--kerf .pnl-seg {
  height: 44px;
  box-sizing: border-box;
  border: 1px solid #cfe0f1;
  border-radius: 6px;
}

.pnl-row--kerf .pnl-seg { padding: 3px; }

.pnl-row--kerf .pnl-seg label { display: flex; }

.pnl-row--kerf .pnl-seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 6px;
  box-sizing: border-box;
}

.pnl-includes {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--pnl-line-soft);
  font-size: 11px;
  line-height: 1.6;
  color: #8a9bb0;
}

.pnl-includes-title {
  margin: 0 0 6px;
  font-size: 10.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 700;
  color: #6b7f96;
}

.pnl-includes ul {
  margin: 0;
  padding-left: 15px;
}

.pnl-includes li { margin: 0 0 2px; }

.pnl-includes-note { margin: 6px 0 0; }

/* Results */

.pnl-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Inline metadata follows its label on the same line. */
.pnl-tool .pnl-meta {
  margin-left: 8px;
  display: inline-block;
  width: 101.93px;
  height: 17px;
  background-image: var(--ref-asset);
  background-repeat: no-repeat;
  background-position: left top;
  background-size: 100% 100%;
  vertical-align: 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pnl-tool .pnl-label .pnl-meta { position: relative; top: 4.5px; }
.pnl-tool .pnl-result-label .pnl-meta { position: relative; top: 3.6px; }

@media (max-width: 768px) {
  .pnl-tool .pnl-meta { display: none; }
}

.pnl-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  line-height: 1.2;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 700;
  border: 1px solid transparent;
}

.pnl-status.is-ok { background: #eaf2f9; color: var(--pnl-blue); }
.pnl-status.is-edge { background: var(--pnl-amber-bg); color: var(--pnl-amber); border-color: var(--pnl-amber-line); }
.pnl-status.is-out { background: var(--pnl-red-bg); color: var(--pnl-red); border-color: var(--pnl-red-line); }

.pnl-diagram {
  margin: 8px 0 0;
  border: 1px solid #e1eaf5;
  border-radius: 8px;
  overflow: hidden;
  background: #fbfdff;
}

.pnl-diagram svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  font-family: Arimo, Arial, Helvetica, sans-serif;
}

.pnl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  margin: 6px 2px 0;
  font-size: 11px;
  line-height: 1.45;
  color: #5c6d82;
}

.pnl-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pnl-legend b {
  font-weight: 600;
  color: #3a4e66;
  white-space: nowrap;
}

.pnl-sw {
  display: inline-block;
  width: 12px;
  height: 9px;
  border-radius: 2px;
  flex: none;
}

.pnl-sw--board { background: #dcebfa; border: 1px solid #8fb4d8; }
.pnl-sw--sheet { background: #fff; border: 1px solid #9fb6cc; }

.pnl-lg-panel { padding-left: 0; }

.pnl-result-label {
  margin: 10px 0 1px;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #5c6d82;
  font-weight: 700;
}

.pnl-big {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--pnl-blue);
  font-weight: 800;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -.03em;
}

.pnl-big small {
  font-size: 15px;
  font-weight: 600;
  color: #2a4767;
}

/* Set-mode headline: the derived set outline, kept right under the board count
   so it is visible without scrolling past the result cards. */
.pnl-set-outline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 0;
  padding: 6px 10px;
  border: 1px solid var(--pnl-line);
  border-left: 3px solid var(--pnl-blue);
  border-radius: 6px;
  background: #f7fbff;
}

.pnl-set-outline span {
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--pnl-muted);
  white-space: nowrap;
}

.pnl-set-outline b {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--pnl-blue);
  letter-spacing: -.01em;
  white-space: nowrap;
}

.pnl-result-note {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #5c6d82;
}

/* Checkbox toggles ("Auto", "Board gaps", "Process rails") sit on their own line. */
.pnl-auto { display: block; }

.pnl-warnings {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.pnl-warnings:empty { display: none; }

/* Source line — normal body text, not fine print */
.pnl-source {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--pnl-text);
}

.pnl-source a {
  color: var(--pnl-blue);
  text-decoration: underline;
}

.pnl-source a:hover { color: var(--pnl-navy); }

.pnl-warn {
  margin: 0;
  padding: 8px 10px;
  border-left: 2px solid var(--pnl-blue);
  border-radius: 4px;
  background: var(--pnl-soft);
  font-size: 11.5px;
  line-height: 1.5;
  color: #3d5875;
}

.pnl-warn.is-edge {
  border-left-color: var(--pnl-amber);
  background: var(--pnl-amber-bg);
  color: #7a4a1e;
}

.pnl-warn.is-out {
  border-left-color: var(--pnl-red);
  background: var(--pnl-red-bg);
  color: #8f2a22;
}

/* Responsive */

@media (max-width: 1000px) {
  .pnl-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 767px) {
  .pnl-panel { padding: 16px; }
  .pnl-controls > .pnl-row2 { margin-top: 14px; }
  /* One column on phones: every field pair stacks, spacing tightened. */
  .pnl-row2 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pnl-label-row { margin-bottom: 5px; }
  .pnl-big { font-size: 38px; }
  .pnl-big small { font-size: 15px; }
  .pnl-diagram svg { max-height: 220px; }
  .pnl-label { font-size: 12px; }
  .pnl-field-label { font-size: 12px; }
  .pnl-mini { font-size: 11px; }
  .pnl-inputwrap input,
  .pnl-select { height: 46px; font-size: 16px; }
  .pnl-select { background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; }
  .pnl-seg span { padding: 12px 6px; font-size: 13px; }
  /* Keep the kerf field and rotation switch the same height on phones. */
  .pnl-row--kerf .pnl-inputwrap input,
  .pnl-row--kerf .pnl-seg { height: 46px; }
  .pnl-help { font-size: 12px; }
  .pnl-result-note { font-size: 13px; }
  .pnl-legend { font-size: 12px; gap: 4px 14px; }
  .pnl-topbar { align-items: flex-start; }
  .pnl-topbar-left { width: 100%; flex-direction: column; align-items: stretch; }
  .pnl-seg--mode { width: 100%; min-width: 0; }
  .pnl-units { width: 100%; justify-content: space-between; }
  .pnl-units .pnl-seg { flex: 1; min-width: 0; }
  .pnl-units-row .pnl-seg { height: 46px; }
  .pnl-lg-panel { width: 100%; padding-left: 0; border-left: 0; }
}

@media (max-width: 380px) {
  .pnl-row2 { grid-template-columns: minmax(0, 1fr); }
  .pnl-seg span { padding: 10px 4px; font-size: 12.5px; }
  .pnl-row--kerf .pnl-seg span { padding: 0 4px; }
}

/* Keep the tool heading clear of the sticky site header when linked by anchor. */
#panel-calculator { scroll-margin-top: 132px; }

@media (max-width: 1024px) {
  #panel-calculator { scroll-margin-top: 104px; }
}

@media (max-width: 767px) {
  #panel-calculator { scroll-margin-top: 92px; }
}

/* -------------------------------------------------------------------------
 * Print sheet
 * Built on demand by the Print / Download PDF button. Only this node and its
 * contents reach the paper: diagram, dimensions, set data, brand header/footer.
 * ---------------------------------------------------------------------- */
#pnl-print-sheet { display: none; }

@media print {
  @page { size: A4 portrait; margin: 12mm; }

  body.pnl-printing > *:not(#pnl-print-sheet) { display: none !important; }

  #pnl-print-sheet {
    display: block !important;
    color: #1e2b3a;
    background: #ffffff;
    font-family: Arimo, Arial, Helvetica, sans-serif;
  }

  #pnl-print-sheet .pnp-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 6px;
    border-bottom: 2px solid #0f4c81;
  }

  #pnl-print-sheet .pnp-brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #0f4c81;
  }

  #pnl-print-sheet .pnp-brand img {
    display: block;
    height: 22px;
    width: auto;
    /* 原 20px/700 文字行的墨迹中心在页眉顶下 15.5px；logo 盒高 22px，下移 4.5px 对齐 */
    margin-top: 4.5px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #pnl-print-sheet .pnp-contact {
    flex: 0 1 auto;
    max-width: 48%;
    font-size: 10px;
    line-height: 1.55;
    color: #4a5a6a;
    text-align: right;
    overflow-wrap: anywhere;
  }

  #pnl-print-sheet .pnp-title {
    margin: 12px 0 2px;
    font-size: 15px;
    font-weight: 700;
    color: #0f4c81;
  }

  #pnl-print-sheet .pnp-sub {
    margin: 0 0 8px;
    font-size: 10.5px;
    color: #4a5a6a;
  }

  #pnl-print-sheet .pnp-figure {
    margin: 6px 0 0;
    text-align: center;
    page-break-inside: avoid;
  }

  #pnl-print-sheet .pnp-figure svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
  }

  #pnl-print-sheet .pnp-table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
    font-size: 10.5px;
    page-break-inside: avoid;
  }

  #pnl-print-sheet .pnp-table th,
  #pnl-print-sheet .pnp-table td {
    padding: 4px 6px;
    border: 1px solid #dbe6f0;
    text-align: left;
  }

  #pnl-print-sheet .pnp-table th {
    width: 38%;
    background: #f0f6fc;
    color: #14356b;
    font-weight: 600;
  }

  #pnl-print-sheet .pnp-foot {
    margin-top: 12px;
    padding-top: 6px;
    border-top: 1px solid #dbe6f0;
    font-size: 9.5px;
    line-height: 1.5;
    color: #6b7f96;
    text-align: center;
  }
}

/* -------------------------------------------------------------------------
 * Article helpers (Elementor content around the calculator)
 * ---------------------------------------------------------------------- */
.pnl-hero-intro,
.pnl-hero-intro p { max-width: 660px !important; }

.pnl-steps ol { margin: 0 0 0 22px; padding: 0; list-style: decimal; }
.pnl-steps li { margin: 0 0 9px; }
.pnl-notes ul { margin: 0 0 0 22px; padding: 0; list-style: disc; }
.pnl-notes li { margin: 0 0 8px; }

/* Comparison table: one shared grid so header and data cells use the same tracks. */
body.elementor-page-268 .elementor-element-ppn-tbl1 {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1px !important;
  padding: 0 !important;
  background: #d6e2ee !important;
}
body.elementor-page-268 .elementor-element-ppn-row1,
body.elementor-page-268 .elementor-element-ppn-row2 {
  display: contents !important;
}
@media (max-width: 767px) {
  body.elementor-page-268 .elementor-element-ppn-tbl1 {
    grid-template-columns: 1fr !important;
  }
  body.elementor-page-268 .elementor-element-ppn-ch11 { order: 1; }
  body.elementor-page-268 .elementor-element-ppn-cb21 { order: 2; }
  body.elementor-page-268 .elementor-element-ppn-ch12 { order: 3; }
  body.elementor-page-268 .elementor-element-ppn-cb22 { order: 4; }
}
