.portal-page {
  min-height: 100vh;
  padding: 9rem 1.5rem 6rem;
  background: #050505;
  color: #f5f5f7;
}

.portal-container {
  width: min(100%, 112rem);
  margin-inline: auto;
}

.portal-auth {
  display: grid;
  min-height: calc(100vh - 15rem);
  place-items: center;
}

.portal-auth-panel {
  width: min(100%, 36rem);
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #0b0b0c;
}

.portal-auth-panel--wide {
  width: min(100%, 46rem);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.portal-eyebrow {
  margin: 0 0 0.8rem;
  color: #2997ff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.portal-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.02;
}

.portal-copy {
  margin: 1rem 0 0;
  color: #9ca3af;
  line-height: 1.7;
}

.portal-form {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.portal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}

.portal-field {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  min-width: 0;
}

.portal-field--wide {
  grid-column: 1 / -1;
}

.portal-field label {
  color: #9ca3af;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-field input:not([type="checkbox"]):not([type="radio"]),
.portal-field select {
  box-sizing: border-box;
  width: 100%;
  height: 2.85rem;
  min-height: 2.85rem;
  padding-block: 0.55rem;
}

.portal-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 6rem;
}

.portal-field input[type="file"] {
  padding: 0.32rem;
  color: #8f8f95;
}

.portal-field input[type="file"]::file-selector-button {
  height: 2.1rem;
  margin-right: 0.7rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: #202023;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.portal-field .helptext,
.portal-field ul {
  margin: 0;
  color: #6b7280;
  font-size: 0.74rem;
  line-height: 1.5;
}

.portal-errors {
  color: #fca5a5;
  font-size: 0.78rem;
}

.portal-button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  min-height: 3.2rem;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  overflow: hidden;
  padding: 0.8rem 1.3rem;
  border: 0;
  border-radius: 7px;
  background: #1677ff;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.portal-button::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.18);
  content: "";
  transform: translateX(-115%) skewX(-18deg);
  transition: transform 520ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.portal-button:hover {
  background: #2997ff;
  transform: translateY(-2px);
}

.portal-button:hover::before {
  transform: translateX(115%) skewX(-18deg);
}

.portal-button i {
  transition: transform 220ms ease;
}

.portal-button:hover i {
  transform: translateX(4px);
}

.portal-button--secondary {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #111113;
}

.portal-button--secondary:hover {
  background: #1b1b1e;
}

.portal-button--small {
  min-height: 2.55rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.74rem;
}

.portal-auth .portal-button {
  width: auto;
  min-width: 12rem;
  justify-self: start;
}

.portal-auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.4rem;
  color: #9ca3af;
  font-size: 0.84rem;
}

.portal-auth-links a {
  color: #64b5ff;
}

.portal-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-user-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.portal-user-meta {
  color: #8b8b91;
  font-size: 0.78rem;
  text-align: right;
}

.portal-message {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 7px;
  background: rgba(37, 99, 235, 0.09);
  color: #dbeafe;
  font-size: 0.86rem;
}

.portal-notifications {
  margin-top: 1.5rem;
  padding: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #0b0b0c;
}

.portal-notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.portal-notifications-header .portal-eyebrow {
  margin-bottom: 0.35rem;
}

.portal-notifications-header h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 1.2rem;
}

.portal-notifications-header h2 span {
  display: inline-flex;
  min-width: 1.6rem;
  height: 1.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #1677ff;
  font-size: 0.7rem;
}

.portal-text-button,
.portal-icon-button {
  border: 0;
  color: #9acbff;
  cursor: pointer;
}

.portal-text-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  background: transparent;
  font-size: 0.76rem;
  font-weight: 700;
}

.portal-icon-button {
  display: inline-flex;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 2.35rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: #151517;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.portal-icon-button:hover {
  border-color: rgba(41, 151, 255, 0.55);
  color: #ffffff;
  transform: translateY(-1px);
}

.portal-notification-list {
  display: grid;
  gap: 1px;
  margin-top: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
}

.portal-notification {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem;
  background: #0e0e10;
}

.portal-notification--unread {
  box-shadow: inset 3px 0 #2997ff;
  background: #11151a;
}

.portal-notification-icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(41, 151, 255, 0.12);
  color: #64b5ff;
  font-size: 0.72rem;
}

.portal-notification strong,
.portal-notification p,
.portal-notification time {
  display: block;
}

.portal-notification strong {
  color: #ffffff;
  font-size: 0.82rem;
}

.portal-notification p {
  margin: 0.2rem 0;
  color: #8f8f95;
  font-size: 0.76rem;
}

.portal-notification time {
  color: #5f5f66;
  font-size: 0.67rem;
}

.portal-section {
  padding: 3.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-section:last-child {
  border-bottom: 0;
}

.portal-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.portal-section-heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 750;
  letter-spacing: 0;
}

.portal-section-heading p {
  max-width: 44rem;
  margin: 0;
  color: #8b8b91;
  line-height: 1.6;
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.portal-stat {
  padding: 1.4rem;
  background: #0b0b0c;
}

.portal-stat strong,
.portal-stat span {
  display: block;
}

.portal-stat strong {
  color: #ffffff;
  font-size: 2rem;
}

.portal-stat span {
  margin-top: 0.35rem;
  color: #7c7c82;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.portal-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.7fr);
  gap: 2rem;
}

.portal-tool {
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #0b0b0c;
}

.portal-tool h3 {
  margin: 0;
  font-size: 1.2rem;
}

.portal-kanban {
  display: grid;
  grid-auto-columns: minmax(17rem, 1fr);
  grid-auto-flow: column;
  gap: 0.8rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x proximity;
}

.portal-column {
  min-height: 24rem;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #09090a;
  scroll-snap-align: start;
}

.portal-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.25rem 0.9rem;
  color: #c7c7cc;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal-column-header span:last-child {
  display: inline-flex;
  min-width: 1.6rem;
  height: 1.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #18181b;
  color: #8b8b91;
}

.portal-column-items {
  display: grid;
  gap: 0.65rem;
}

.portal-card {
  position: relative;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  background: #111113;
}

.portal-card--draggable {
  cursor: grab;
  transition: border-color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.portal-card--draggable:active {
  cursor: grabbing;
}

.portal-card--draggable.is-dragging {
  opacity: 0.45;
  transform: scale(0.98);
}

.portal-card--draggable.is-saving {
  pointer-events: none;
  opacity: 0.7;
}

.portal-card--draggable.is-saved {
  border-color: rgba(52, 211, 153, 0.55);
}

.portal-column.is-drop-target {
  border-color: rgba(41, 151, 255, 0.6);
  background: rgba(41, 151, 255, 0.05);
}

.portal-drag-handle {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  color: #55555c;
  font-size: 0.8rem;
}

.portal-card--draggable h3 {
  padding-right: 1.4rem;
}

.portal-card h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.35;
}

.portal-card p {
  margin: 0.7rem 0 0;
  color: #8f8f95;
  font-size: 0.82rem;
  line-height: 1.55;
}

.portal-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.portal-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: #1b1b1e;
  color: #a9a9af;
  font-size: 0.68rem;
  font-weight: 700;
}

.portal-chip--urgent {
  background: rgba(225, 29, 72, 0.14);
  color: #fda4af;
}

.portal-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
  color: #64b5ff;
  font-size: 0.76rem;
  font-weight: 700;
}

.portal-card form {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.portal-card select,
.portal-card textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: #09090a;
  color: #ffffff;
  font-size: 0.76rem;
}

.portal-card select {
  min-height: 2.5rem;
  padding: 0 0.65rem;
}

.portal-card textarea {
  min-height: 5rem;
  padding: 0.7rem;
  resize: vertical;
}

.portal-updates {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-update {
  color: #8f8f95;
  font-size: 0.74rem;
  line-height: 1.5;
}

.portal-update + .portal-update {
  margin-top: 0.55rem;
}

.portal-empty {
  padding: 1rem 0.5rem;
  color: #55555b;
  font-size: 0.78rem;
}

.portal-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.portal-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(8rem, 0.5fr) minmax(8rem, 0.5fr);
  gap: 1rem;
  padding: 1rem;
  background: #0b0b0c;
}

.portal-list-row strong {
  color: #ffffff;
}

.portal-list-row span {
  color: #85858b;
  font-size: 0.82rem;
}

.portal-workspace {
  max-width: 92rem;
}

.portal-workspace-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: #8f8f95;
  font-size: 0.78rem;
  font-weight: 700;
}

.portal-back-link:hover {
  color: #ffffff;
}

.portal-order-summary {
  display: flex;
  min-width: 15rem;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #0b0b0c;
}

.portal-order-summary small,
.portal-order-summary strong {
  display: block;
}

.portal-order-summary small {
  margin-bottom: 0.2rem;
  color: #73737a;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.portal-order-summary strong {
  font-size: 0.9rem;
}

.portal-status-dot {
  width: 0.7rem;
  height: 0.7rem;
  flex: 0 0 0.7rem;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 0.35rem rgba(96, 165, 250, 0.12);
}

.portal-status-dot--ready,
.portal-status-dot--ready_paid {
  background: #34d399;
  box-shadow: 0 0 0 0.35rem rgba(52, 211, 153, 0.12);
}

.portal-order-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 2rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.portal-order-meta > div {
  padding: 1rem;
  background: #0b0b0c;
}

.portal-order-meta span,
.portal-order-meta strong {
  display: block;
}

.portal-order-meta span {
  margin-bottom: 0.3rem;
  color: #6f6f76;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.portal-order-meta strong {
  font-size: 0.88rem;
}

.portal-order-description {
  padding-bottom: 2rem;
}

.portal-order-description > p:last-child {
  max-width: 58rem;
  margin: 0;
  color: #a2a2a8;
  line-height: 1.7;
}

.portal-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(20rem, 0.75fr);
  gap: 2rem;
}

.portal-workspace-grid > .portal-section {
  border-bottom: 0;
}

.portal-message-thread {
  display: grid;
  max-height: 42rem;
  gap: 0.8rem;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.portal-chat-message {
  max-width: 88%;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: #101012;
}

.portal-chat-message--own {
  margin-left: auto;
  border-color: rgba(41, 151, 255, 0.25);
  background: rgba(41, 151, 255, 0.08);
}

.portal-chat-message--internal {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.06);
}

.portal-chat-message header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.portal-chat-message header strong {
  font-size: 0.78rem;
}

.portal-chat-message time {
  color: #626269;
  font-size: 0.67rem;
}

.portal-chat-message p {
  margin: 0.7rem 0 0;
  color: #b2b2b7;
  font-size: 0.86rem;
  line-height: 1.6;
}

.portal-internal-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.65rem;
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 700;
}

.portal-file-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  color: #64b5ff;
  font-size: 0.75rem;
  font-weight: 700;
}

.portal-compose-form,
.portal-file-form {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-compose-form .portal-button {
  min-width: 13rem;
  justify-self: start;
}

.portal-check-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #9a9aa0;
  font-size: 0.76rem;
  cursor: pointer;
}

.portal-check-field input {
  width: 1rem;
  height: 1rem;
  accent-color: #2997ff;
}

.portal-file-list {
  display: grid;
  gap: 0.6rem;
}

.portal-project-file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  background: #101012;
}

.portal-project-file-icon {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border-radius: 7px;
  background: rgba(41, 151, 255, 0.1);
  color: #64b5ff;
}

.portal-project-file strong,
.portal-project-file span,
.portal-project-file small {
  display: block;
}

.portal-project-file strong {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-project-file span,
.portal-project-file small {
  margin-top: 0.2rem;
  color: #696970;
  font-size: 0.67rem;
}

.portal-project-file small {
  color: #fbbf24;
}

@media (max-width: 1023px) {
  .portal-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-split {
    grid-template-columns: 1fr;
  }

  .portal-workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 639px) {
  .portal-page {
    padding: 7.5rem 1rem 4rem;
  }

  .portal-form-grid,
  .portal-stats {
    grid-template-columns: 1fr;
  }

  .portal-auth .portal-button {
    width: 100%;
  }

  .portal-compose-form .portal-button {
    width: 100%;
  }

  .portal-topbar,
  .portal-section-heading,
  .portal-workspace-header,
  .portal-notifications-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-user-actions {
    width: 100%;
    justify-content: space-between;
  }

  .portal-user-meta {
    text-align: left;
  }

  .portal-list-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .portal-order-summary {
    width: 100%;
  }

  .portal-order-meta {
    grid-template-columns: 1fr;
  }

  .portal-chat-message {
    max-width: 100%;
  }

  .portal-notification {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .portal-notification > form {
    grid-column: 2;
  }
}
