.portal {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(112deg, #131416 8%, #131416db 46%, #151618b5 100%),
              var(--page-relief) center top / cover fixed;
}

.portal-mast {
  min-height: 4.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem 1.5rem;
  padding-block: .65rem;
}

.portal-mast .brand { flex-wrap: wrap; }
.portal-mast .brand span {
  color: var(--gold);
  font: 600 .83rem/1.2 Geist, Arial, sans-serif;
  letter-spacing: 0;
}

.portal-header-actions, .portal-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem .75rem;
}

#portal-account {
  max-width: min(32ch, 34vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: .87rem;
}

.portal-main {
  max-width: 83rem;
  padding-block: clamp(1.7rem, 6vh, 4.8rem) 5rem;
}

.portal-main h1 {
  margin-bottom: clamp(1.05rem, 2.4vw, 2.1rem);
  font-size: clamp(2.2rem, 5.2vw, 4.45rem);
  line-height: 1.06;
  letter-spacing: -.05em;
}

.portal-signin {
  display: grid;
  align-items: center;
  min-height: min(64vh, 36rem);
  padding-block: 1rem;
}

.portal-signin h1 { max-width: 15ch; text-wrap: balance; }
.portal-signin p { max-width: 46ch; color: var(--muted); margin-bottom: 1.5rem; }
.portal-signin .primary { display: inline-flex; }
.portal-signin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; }

.portal-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: .55rem .85rem;
  min-height: 2.7rem;
  background: #232426;
  border: 1px solid #50493f;
  border-radius: .5rem;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 600;
}

.portal-button:hover, .portal-button:focus-visible { background: #302c25; border-color: #a58960; }
.portal-button:disabled, .portal .primary:disabled { opacity: .55; cursor: wait; }
.portal-notice {
  max-width: 57rem;
  margin-bottom: 1.2rem;
  padding: .78rem 1rem;
  border: 1px solid #746047;
  border-radius: .53rem;
  background: #26221b;
  color: #f2d3a3;
  overflow-wrap: anywhere;
}

.portal-notice[data-error] {
  color: #ffd2c7;
  background: #352222;
  border-color: #89574e;
}

.portal-workspace {
  display: grid;
  grid-template-columns: minmax(11rem, 17.5rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.2rem, 3vw, 3rem);
}

.portal-sidebar {
  padding: .8rem;
  border: 1px solid #49433a;
  border-radius: .82rem;
  background: #1a1b1dea;
}
.portal-sidebar label { display: block; padding: .22rem .38rem; color: var(--muted); font-size: .86rem; }
#portal-nav { display: grid; gap: .23rem; margin-top: .82rem; }
#portal-nav button {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: .43rem;
  min-height: 2.75rem;
  padding: .45rem .62rem;
  text-align: left;
  font-size: .92rem;
  font-weight: 600;
}
#portal-nav button:hover { background: #292827; color: var(--ink); }
#portal-nav button[aria-current] { background: #382e20; border-color: #665035; color: #f2c57f; }

.portal-content { min-width: 0; max-width: 57rem; }
.portal-panel, .portal-product {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: clamp(1rem, 2.7vw, 2.3rem);
  background: linear-gradient(130deg, #262628, #1b1c1e 68%);
  border: 1px solid #4b4439;
  border-radius: .82rem;
  box-shadow: 0 .7rem 1.5rem #0002;
  overflow-wrap: anywhere;
}
.portal-panel h2, .portal-product h2, .portal-item h3 {
  max-width: 100%;
  font-size: clamp(1.28rem, 2.5vw, 1.85rem);
  letter-spacing: -.035em;
  line-height: 1.18;
}
.portal-product-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
}
.portal-product { gap: .7rem; }
.portal-product img { width: 2.9rem; height: 2.9rem; }
.portal-subtle, .portal-panel p { color: var(--muted); }
.portal-field { display: grid; gap: .42rem; width: 100%; font-size: .94rem; }
.portal-field small { color: var(--muted); }
.portal-number { max-width: 23rem; }
.portal-inline-form { display: grid; width: 100%; justify-items: start; gap: .75rem; }
#portal-pairing { max-width: 37rem; }
.portal :is(input, select, textarea) {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #17181a;
  border: 1px solid #514a40;
  border-radius: .44rem;
  padding: .63rem .72rem;
  min-height: 2.75rem;
  font: inherit;
}
.portal textarea { resize: vertical; }
.portal [type=file]::file-selector-button {
  background: #363028;
  color: var(--ink);
  border: 1px solid #695b48;
  border-radius: .3rem;
  padding: .25rem .55rem;
  margin-inline-end: .6rem;
  font: inherit;
}
.portal-invite-result { width: 100%; display: grid; gap: .65rem; justify-items: start; }
.portal-items { display: grid; width: 100%; min-width: 0; gap: .65rem; }
.portal-item {
  display: grid;
  gap: .55rem;
  overflow-wrap: anywhere;
  border: 1px solid #3e3a35;
  border-radius: .58rem;
  padding: .85rem 1rem;
  background: #1b1c1e;
}
.portal-item h3 { font-size: 1.22rem; }
.portal-item .portal-summary { white-space: pre-wrap; }
.portal-item h3, .portal-item p { max-width: 70ch; }
.portal-status {
  width: fit-content;
  padding: .13rem .52rem;
  border-radius: .35rem;
  background: #332a1e;
  color: #f2ce92;
  font-size: .8rem;
  font-weight: 600;
}

@media (max-width: 46rem) {
  .portal-workspace { grid-template-columns: 1fr; }
  #portal-nav { display: flex; flex-wrap: wrap; gap: .3rem; }
}
@media (max-width: 38rem) {
  .portal-mast { flex-wrap: wrap; }
  #portal-account { max-width: 100%; flex-basis: 100%; }
  .portal-main h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
  .portal-signin { min-height: 53vh; }
}
