:root {
  color-scheme: light;
  --pc-blue: #2f79b9;
  --pc-blue-dark: #1b5f98;
  --pc-blue-soft: #edf6fc;
  --pc-green: #54a852;
  --pc-green-dark: #398a41;
  --pc-green-soft: #eff9ef;
  --pc-ink: #17354d;
  --pc-muted: #627a8d;
  --pc-line: #dbe7ef;
  --pc-bg: #f5f9fc;
  --pc-white: #fff;
  --pc-radius: 16px;
  --pc-shadow: 0 16px 40px rgba(30, 87, 128, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 0;
  margin: 0;
  background: transparent;
  color: var(--pc-ink);
}

body {
  padding: 2px;
}

button,
select {
  font: inherit;
}

.pc-calculator {
  width: min(100%, 1120px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--pc-line);
  border-radius: 20px;
  background: var(--pc-white);
  box-shadow: var(--pc-shadow);
}

.pc-header {
  height: clamp(32.5px, 4.25vw, 36.5px);
  border-bottom: 1px solid #cfe0ec;
  background:
    radial-gradient(circle at 92% 8%, rgba(84, 168, 82, 0.18), transparent 25%),
    linear-gradient(135deg, #f7fbfe, #e9f5fd);
}

.pc-step {
  margin: 0 0 4px;
  color: var(--pc-blue-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pc-result h2 {
  margin: 0;
  letter-spacing: -0.025em;
}

.pc-config {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 11px 18px 12px;
  border-bottom: 1px solid var(--pc-line);
}

.pc-note,
.pc-status,
#pc-method-note {
  color: var(--pc-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.pc-fields,
.pc-fields-more {
  display: contents;
}

.pc-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pc-field > span {
  color: #48677d;
  font-size: 0.66rem;
  font-weight: 800;
}

.pc-field select,
.pc-product-trigger {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 34px 0 11px;
  border: 1px solid #bfd3e2;
  border-radius: 8px;
  outline: none;
  background: var(--pc-white);
  color: var(--pc-ink);
  font-size: 0.74rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pc-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%231b5f98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 7.5 5 5 5-5'/%3E%3C/svg%3E");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 15px 15px;
}

.pc-product-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.pc-product-trigger strong {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-product-chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--pc-blue-dark);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 0.15s ease;
}

.pc-product-trigger[aria-expanded="true"] .pc-product-chevron {
  transform: rotate(180deg);
}

.pc-field select:focus,
.pc-product-trigger:focus-visible {
  border-color: var(--pc-blue);
  box-shadow: 0 0 0 3px rgba(47, 121, 185, 0.13);
}

.pc-field select:disabled {
  cursor: wait;
  background-color: #f5f7f9;
  color: var(--pc-muted);
}

.pc-product-trigger:disabled {
  cursor: wait;
  background: #f5f7f9;
  color: var(--pc-muted);
}

.pc-more {
  grid-column: 1 / -1;
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  background: #fbfdff;
}

.pc-more summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--pc-blue-dark);
  font-size: 0.78rem;
  font-weight: 800;
  list-style: none;
}

.pc-more summary::-webkit-details-marker {
  display: none;
}

.pc-more summary::after {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transform-origin: center;
  transition: transform 0.15s ease;
}

.pc-more[open] summary::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.pc-fields-more {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 9px 9px;
}

.pc-result {
  padding: 11px 18px 20px;
}

.pc-result-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 7px;
}

.pc-result h2 {
  font-size: 0.94rem;
}

#pc-method-note {
  max-width: 42%;
  margin: 0;
  text-align: right;
}

.pc-table-wrap {
  overflow: hidden;
  border: 1px solid #c9dce9;
  border-radius: 13px;
}

.pc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.pc-table th,
.pc-table td {
  padding: 5px 7px;
  border-bottom: 1px solid var(--pc-line);
  border-left: 1px solid var(--pc-line);
  text-align: center;
  vertical-align: middle;
}

.pc-table th:first-child,
.pc-table td:first-child {
  border-left: 0;
}

.pc-table tr:last-child > * {
  border-bottom: 0;
}

.pc-table thead th {
  background: var(--pc-blue-dark);
  color: var(--pc-white);
  font-size: 0.77rem;
}

.pc-table thead th:first-child {
  width: 25%;
  background: #174f7c;
}

.pc-table thead small {
  display: block;
  margin-top: 2px;
  color: #d4e9f8;
  font-size: 0.63rem;
  font-weight: 500;
}

.pc-table tbody th {
  background: #f6fafd;
  color: var(--pc-ink);
  font-size: 0.78rem;
}

.pc-price {
  display: grid;
  width: 100%;
  min-height: 35px;
  place-content: center;
  gap: 2px;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--pc-ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.pc-price:hover {
  border-color: #9dc7e4;
  background: var(--pc-blue-soft);
}

.pc-price[data-selected="true"] {
  border-color: var(--pc-green);
  background: var(--pc-green-soft);
  color: #1d6d31;
}

.pc-price strong {
  font-size: clamp(0.78rem, 2vw, 0.96rem);
  font-variant-numeric: tabular-nums;
}

.pc-price small {
  color: var(--pc-muted);
  font-size: 0.63rem;
}

.pc-price.pc-quote {
  color: var(--pc-blue-dark);
  font-size: 0.69rem;
  font-weight: 800;
}

.pc-manager {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid #b9daba;
  border-radius: 13px;
  background: var(--pc-green-soft);
}

.pc-manager-icon {
  display: grid;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--pc-green);
  color: white;
  font-weight: 900;
}

.pc-manager strong {
  color: #246b32;
  font-size: 0.86rem;
}

.pc-manager p {
  margin: 4px 0 0;
  color: #497a52;
  font-size: 0.75rem;
  line-height: 1.45;
}

.pc-note {
  margin: 7px 0 0;
}

.pc-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.pc-button {
  min-height: 38px;
  min-width: 150px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pc-green), var(--pc-green-dark));
  box-shadow: 0 8px 18px rgba(57, 138, 65, 0.18);
  color: white;
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 800;
}

.pc-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.pc-fold-trigger {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  width: 100%;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 3px 9px 3px 5px;
  border: 1px solid #bfd3e2;
  border-radius: 10px;
  background: white;
  color: var(--pc-ink);
  cursor: pointer;
  text-align: left;
}

.pc-fold-trigger svg,
.pc-fold-option svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.15;
}

.pc-fold-art * {
  vector-effect: non-scaling-stroke;
}

.pc-fold-panel {
  fill: #edf8fc;
  stroke: #405c6c;
  stroke-width: 1.15;
}

.pc-fold-shadow {
  fill: #e4f1f7;
  stroke: #718a98;
  stroke-width: 1.45;
}

.pc-fold-crease,
.pc-fold-layer {
  fill: none;
  stroke: #5f7988;
  stroke-width: 1.35;
}

.pc-fold-guide {
  fill: none;
  stroke: #8ba8b8;
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}

.pc-fold-mark {
  fill: none;
  stroke: #557483;
  stroke-width: 1.5;
}

.pc-fold-trigger svg {
  width: 34px;
  height: 34px;
  color: var(--pc-blue-dark);
}

.pc-fold-trigger strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-fold-trigger i {
  color: var(--pc-blue-dark);
  font-size: 0.67rem;
  font-style: normal;
  font-weight: 800;
}

.pc-modal {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
}

.pc-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(13, 42, 64, 0.56);
  cursor: pointer;
}

.pc-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: min(86vh, 760px);
  padding: 21px;
  overflow: auto;
  border-radius: 17px;
  background: white;
  box-shadow: 0 24px 70px rgba(13, 42, 64, 0.28);
}

.pc-modal-card h2 {
  margin: 0;
  font-size: 1.15rem;
}

.pc-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--pc-line);
  border-radius: 50%;
  background: white;
  color: var(--pc-muted);
  cursor: pointer;
  font-size: 1.15rem;
}

.pc-order-summary {
  margin: 9px 34px 15px 0;
  color: var(--pc-muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.pc-channel-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.pc-channel {
  display: grid;
  min-width: 0;
  place-items: center;
  gap: 3px;
  padding: 15px 8px;
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  color: var(--pc-ink);
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.pc-channel:hover {
  border-color: var(--pc-blue);
  transform: translateY(-1px);
}

.pc-channel-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 3px;
}

.pc-channel-icon svg {
  display: block;
  width: 34px;
  height: 34px;
}

.pc-channel strong {
  font-size: 0.8rem;
}

.pc-channel small,
.pc-modal-hint {
  color: var(--pc-muted);
  font-size: 0.66rem;
  line-height: 1.35;
}

.pc-modal-hint {
  margin: 12px 0 0;
}

.pc-fold-card {
  width: min(100%, 1040px);
}

.pc-product-card {
  width: min(100%, 1120px);
  max-height: min(84vh, 720px);
}

.pc-product-hint {
  margin: 6px 38px 15px 0;
  color: var(--pc-muted);
  font-size: 0.74rem;
}

.pc-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(70px, auto));
  grid-auto-flow: column;
  gap: 9px;
}

.pc-product-option {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--pc-line);
  border-radius: 11px;
  background: #fbfdff;
  color: var(--pc-ink);
  cursor: pointer;
  text-align: left;
}

.pc-product-option:hover,
.pc-product-option:focus-visible,
.pc-product-option[data-selected="true"] {
  border-color: var(--pc-green);
  outline: none;
  background: var(--pc-green-soft);
}

.pc-product-option strong {
  font-size: 0.78rem;
}

.pc-product-option small {
  overflow: hidden;
  color: var(--pc-muted);
  font-size: 0.64rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc-fold-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.pc-fold-option {
  display: grid;
  min-height: 168px;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 14px 10px 12px;
  border: 1px solid #c7dce8;
  border-radius: 7px;
  background: linear-gradient(180deg, #f1fbff 0%, #e5f5fc 100%);
  color: var(--pc-ink);
  cursor: pointer;
}

.pc-fold-option:hover,
.pc-fold-option[data-selected="true"] {
  border-color: var(--pc-green);
  background: var(--pc-green-soft);
}

.pc-fold-option svg {
  width: 100px;
  height: 116px;
  color: #446173;
}

.pc-fold-option strong {
  display: grid;
  gap: 2px;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: center;
}

.pc-fold-option strong small {
  color: var(--pc-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.pc-error {
  margin: 16px 24px 22px;
  padding: 12px;
  border: 1px solid #efb8b8;
  border-radius: 10px;
  background: #fff5f5;
  color: #a63f3f;
  font-size: 0.8rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .pc-config {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pc-fields-more {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pc-product-grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }
}

@media (max-width: 560px) {
  body {
    padding: 0;
  }

  .pc-calculator {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .pc-config,
  .pc-result {
    padding-right: 10px;
    padding-left: 10px;
  }

  .pc-result {
    padding-bottom: 16px;
  }

  .pc-config,
  .pc-fields-more {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .pc-more .pc-fields-more {
    padding: 0 9px 9px;
  }

  .pc-result-heading {
    display: block;
  }

  #pc-method-note {
    max-width: none;
    margin-top: 5px;
    text-align: left;
  }

  .pc-table th,
  .pc-table td {
    padding: 6px 4px;
  }

  .pc-table thead th:first-child {
    width: 23%;
  }

  .pc-table thead small {
    display: none;
  }

  .pc-price {
    min-height: 48px;
    padding: 3px;
  }

  .pc-price strong {
    font-size: 0.75rem;
  }

  .pc-price small {
    font-size: 0.58rem;
  }

  .pc-actions {
    display: flex;
  }

  .pc-button {
    width: auto;
    max-width: 100%;
  }

  .pc-modal {
    align-items: end;
    padding: 0;
  }

  .pc-modal-card {
    width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
  }

  .pc-product-card {
    max-height: 92vh;
  }

  .pc-product-grid {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .pc-product-option {
    min-height: 64px;
  }

  .pc-channel-list {
    grid-template-columns: 1fr;
  }

  .pc-channel {
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto;
    justify-items: start;
    padding: 10px 12px;
    text-align: left;
  }

  .pc-channel-icon {
    grid-row: 1 / 3;
    margin: 0;
  }

  .pc-fold-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pc-fold-option {
    min-height: 148px;
  }
}

/* Keep all eight folding choices compact on phones. */
@media (max-width: 560px) {
  .pc-fold-card { padding: 14px 12px; max-height: 90dvh; }
  .pc-fold-card h2 { font-size: 1.05rem; padding-right: 30px; }
  .pc-fold-grid { gap: 7px; margin-top: 10px; }
  .pc-fold-option { min-height: 94px; padding: 7px 5px; gap: 3px; }
  .pc-fold-option svg { width: 48px; height: 56px; }
  .pc-fold-option strong { font-size: 0.68rem; gap: 1px; }
  .pc-fold-option strong small { font-size: 0.6rem; }
}
