.pt-view {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.pt-heading {
  margin-bottom: 0;
}

.pt-heading p,
.pt-section h2,
.pt-pick h3,
.pt-form-card h2 {
  margin: 0;
}

.pt-heading p {
  margin-top: 6px;
}

.pt-actions,
.pt-section-head,
.pt-resume {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.pt-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pt-metric {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: clamp(14px, 2vw, 22px);
}

.pt-metric > span,
.pt-metric > small {
  font-size: .82rem;
}

.pt-metric strong {
  font-size: clamp(1.05rem, 2vw, 1.65rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.pt-section {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.pt-section h2,
.pt-form-card h2 {
  font-size: 1.1rem;
}

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

.pt-pick,
.pt-form-card,
.pt-empty {
  padding: clamp(16px, 2vw, 24px);
}

.pt-pick h3 {
  font-size: 1rem;
}

.pt-pick ol {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.pt-pick li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.pt-pick li:last-child {
  padding-bottom: 0;
}

.pt-pick li > span:last-child {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.pt-notice {
  margin: 0;
  padding: 12px 16px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.pt-notice--saved {
  color: var(--positive);
}

.pt-table {
  min-width: 0;
  padding: 0;
}

.pt-table table {
  width: 100%;
  border-spacing: 0;
  text-align: left;
}

.pt-table th,
.pt-table td {
  padding: 12px clamp(8px, 1.1vw, 16px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.pt-table thead th {
  color: var(--muted);
  font-size: .77rem;
  font-weight: 600;
}

.pt-table tbody :is(th, td) {
  border-top: 1px solid var(--line);
  font-size: .86rem;
}

.pt-table tbody th {
  min-width: 9ch;
}

.pt-table small {
  display: block;
  margin-top: 2px;
}

.pt-table .pt-row-action {
  text-align: right;
}

.pt-row-action .button {
  font-size: .79rem;
  text-align: center;
}

.pt-item-link {
  color: var(--text);
  text-decoration-color: var(--muted);
  text-underline-offset: .2em;
}

.pt-item-link:hover {
  color: var(--accent);
}

.pt-side {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-2);
}

.pt-side--buy {
  color: var(--accent);
}

.pt-switch {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.pt-switch a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.pt-switch a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--text);
}

.pt-order {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.pt-fields,
.pt-amounts,
.pt-field {
  display: grid;
  min-width: 0;
}

.pt-fields {
  gap: 18px;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.pt-amounts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pt-field {
  align-content: start;
  gap: 6px;
}

.pt-field label,
.pt-breakdown {
  font-size: .9rem;
}

.pt-field :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--bg);
  font: inherit;
  font-size: max(16px, 1rem);
}

.pt-field :is(input, select):focus-visible,
.pt-switch a:focus-visible,
.pt-item-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.pt-field small:empty,
.pt-form-state:empty {
  display: none;
}

.pt-breakdown {
  display: grid;
  gap: 0;
  margin: 12px 0;
}

.pt-breakdown > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.pt-breakdown dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pt-estimate-note,
.pt-form-state {
  margin: 12px 0;
  font-size: .84rem;
}

.pt-form-state {
  color: var(--accent);
}

.pt-submit {
  width: 100%;
  min-height: 44px;
}

.pt-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .pt-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pt-table {
    border: 0;
    background: transparent;
  }

  .pt-table :is(table, tbody) {
    display: block;
  }

  .pt-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .pt-table tbody {
    display: grid;
    gap: 10px;
  }

  .pt-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .pt-table tbody :is(th, td) {
    padding: 0;
    border-top: 0;
  }

  .pt-table tbody th {
    grid-column: 1 / -1;
    font-size: .98rem;
  }

  .pt-table td[data-label]::before {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .75rem;
    content: attr(data-label);
  }

  .pt-table .pt-row-action {
    grid-column: 1 / -1;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .pt-view {
    gap: 14px;
  }

  .pt-picks,
  .pt-order {
    grid-template-columns: minmax(0, 1fr);
  }

  .pt-switch {
    width: 100%;
  }

  .pt-switch a {
    flex: 1;
  }

  .pt-metrics {
    gap: 8px;
  }

  .pt-row-action .button {
    width: 100%;
    min-height: 44px;
  }
}

.pt-submit:disabled {
  cursor: wait;
  opacity: .7;
}
