.portal {
  padding: clamp(36px, 5vw, 80px) var(--gutter) 100px;
  min-height: 65vh;
  font-size: 18px;
  line-height: 1.45;
}
.portal h1 {
  font-size: clamp(42px, 5vw, 80px);
  max-width: 12ch;
  letter-spacing: -0.035em;
}
.portal h2 {
  font-size: 28px;
  letter-spacing: -0.025em;
}
.portal h3 {
  font-size: 21px;
  letter-spacing: -0.02em;
}
.portal p {
  max-width: 68ch;
}
.portal a,
.portal button {
  text-underline-offset: 4px;
}
.portal button:disabled {
  opacity: 0.55;
}
.portal label,
.portal-dialog label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.portal input,
.portal-dialog input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--wine);
  border-radius: 0;
  background: transparent;
  color: var(--wine);
  min-height: 48px;
  padding: 10px 12px;
  caret-color: var(--wine);
}
.portal input::placeholder {
  color: var(--wine);
  opacity: 0.7;
}
.portal-auth {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(40px, 10vw, 160px);
  max-width: 1300px;
}
.portal-auth > div {
  display: grid;
  align-content: start;
  gap: 24px;
}
.portal-auth form {
  display: grid;
  gap: 22px;
  border-top: 1px solid var(--wine);
  padding-top: 26px;
  max-width: 480px;
}
.portal-auth form h2 {
  margin-bottom: 8px;
}
.portal-muted {
  font-size: 16px;
  line-height: 1.5;
}
.portal-error {
  border: 1px solid var(--wine);
  padding: 14px 18px;
  font-weight: 500;
}
.portal-heading {
  display: flex;
  gap: 28px;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 26px;
}
.portal-heading > div > p {
  margin-bottom: 14px;
}
.portal-actions {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.portal-intro {
  margin-bottom: 18px;
}
.portal-orders {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 48px;
}
.portal-order {
  border-top: 1px solid var(--wine);
  padding: 24px 0 28px;
}
.portal-order header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}
.portal-order h2 {
  margin-top: 4px;
}
.portal-status {
  font-size: 14px;
  border: 1px solid var(--wine);
  padding: 5px 10px;
  white-space: nowrap;
}
.portal-order ul {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}
.portal-order li {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.portal-order li small {
  display: block;
  font-size: 14px;
  margin-top: 4px;
}
.portal-order li strong {
  font-weight: 500;
  white-space: nowrap;
}
.portal-order dl {
  margin: 24px 0;
  display: grid;
  gap: 6px;
  font-size: 16px;
}
.portal-order dl > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.portal-order dd {
  margin: 0;
  white-space: nowrap;
}
.portal-order .portal-total {
  font-weight: 700;
  font-size: 19px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 10px;
}
.portal-history {
  margin-top: 52px;
  border-top: 1px solid var(--wine);
  padding-top: 28px;
}
.portal-history > h2 {
  margin-bottom: 24px;
}
.portal-history article {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
}
.portal-history article > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.portal-history summary {
  cursor: pointer;
  min-height: 44px;
}
.portal-comment,
.portal-pending,
.portal-feedback {
  background: var(--wine);
  color: var(--pink);
  padding: 16px 20px;
}
.portal-feedback {
  margin-top: 24px;
}
.portal-empty {
  padding: 28px 0;
  grid-column: 1/-1;
  display: grid;
  gap: 16px;
}
.portal-dialog {
  border: 1px solid var(--wine);
  background: var(--pink);
  color: var(--wine);
  max-width: min(640px, calc(100% - 32px));
  width: 100%;
  max-height: 90svh;
  padding: 28px;
  overflow: auto;
  font-family: Diatype, Arial, sans-serif;
}
.portal-dialog::backdrop {
  background: rgb(30 0 15 / 0.5);
}
.portal-dialog form {
  display: grid;
  gap: 24px;
}
.portal-dialog header,
.portal-dialog footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.portal-dialog header > button {
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
}
.portal-dialog h2 {
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.portal-dialog fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
.portal-dialog legend {
  font-size: 16px;
  margin-bottom: 16px;
}
.portal-dialog .portal-quantity {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.portal-quantity input {
  max-width: 100px;
}
.portal-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.portal-preview {
  border-top: 1px solid var(--wine);
  border-bottom: 1px solid var(--wine);
  padding: 20px 0;
  display: grid;
  gap: 10px;
}
.portal-preview strong {
  font-size: 25px;
}
.portal-preview p {
  font-size: 16px;
}
.portal-preview h3 {
  font-size: 18px;
}
.portal-dialog footer .button {
  font-size: 18px;
}
.portal a:focus-visible,
.portal button:focus-visible,
.portal input:focus-visible,
.portal-dialog :focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 4px;
}
@media (max-width: 760px) {
  .portal-auth {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .portal-auth form {
    max-width: none;
  }
  .portal-heading {
    align-items: start;
    flex-direction: column;
  }
  .portal-orders {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .portal-actions {
    gap: 24px;
  }
  .portal .button {
    font-size: 18px;
  }
  .portal-dialog {
    padding: 20px;
  }
  .portal-dialog footer {
    gap: 16px;
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .portal-dialog footer .text-link {
    align-self: center;
  }
  .portal-history article > div {
    flex-wrap: wrap;
  }
  .portal h1 {
    max-width: 14ch;
  }
}
