.portal-hero,
.public-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 8px 2px 28px;
  border-bottom: 1px solid var(--ov-border);
}

.portal-hero > div,
.public-hero > div {
  min-width: 0;
}

.portal-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: var(--ov-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.portal-hero h1,
.public-hero h1 {
  margin: 0 0 10px;
  color: var(--ov-accent);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.portal-hero p,
.public-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--ov-muted);
  font-size: 15px;
  line-height: 1.6;
}

.portal-manage-link,
.public-hero__actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid var(--ov-border-strong);
  border-radius: 999px;
  background: var(--ov-surface-raised);
  color: var(--ov-text);
  text-decoration: none;
  white-space: nowrap;
}

.portal-manage-link:hover,
.public-hero__actions a:hover {
  background: var(--ov-active);
  color: var(--ov-accent);
}

.portal-workspaces {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-top:28px;
}

.portal-workspace-card {
  display:grid;
  min-height:142px;
  grid-template-columns:42px minmax(0,1fr) 18px;
  align-items:center;
  gap:14px;
  padding:18px;
  border:1px solid var(--ov-border);
  border-radius:var(--ov-radius-lg);
  background:var(--ov-surface);
  color:var(--ov-text);
  text-decoration:none;
  transition:border-color .16s ease,background .16s ease,transform .16s ease;
}
.portal-workspace-card:hover { border-color:var(--ov-border-strong);background:var(--ov-active);transform:translateY(-2px); }
.portal-workspace-card.is-primary { border-color:var(--ov-border-strong);background:var(--ov-surface-raised); }
.portal-workspace-card__icon { display:grid;width:42px;height:42px;place-items:center;border:1px solid var(--ov-border-strong);border-radius:12px;background:var(--ov-surface-raised); }
.portal-workspace-card__icon .ov-icon { width:18px;height:18px; }
.portal-workspace-card>span:nth-child(2) { min-width:0; }
.portal-workspace-card small,.portal-workspace-card strong,.portal-workspace-card em { display:block; }
.portal-workspace-card small { margin-bottom:7px;color:#777;font-size:9px;font-style:normal;letter-spacing:.06em;text-transform:uppercase; }
.portal-workspace-card strong { color:var(--ov-accent);font-size:19px;font-weight:500; }
.portal-workspace-card em { margin-top:5px;overflow:hidden;color:var(--ov-muted);font-size:10px;font-style:normal;text-overflow:ellipsis;white-space:nowrap; }
.portal-workspace-card>.ov-icon { width:16px;height:16px;color:#777; }

.service-portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1px;
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--ov-border);
  border-radius: var(--ov-radius-lg);
  background: var(--ov-border);
}

@media(max-width:980px){.portal-workspaces{grid-template-columns:1fr}.portal-workspace-card{min-height:110px}}

.service-portal-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 270px;
  flex-direction: column;
  padding: 22px;
  background: var(--ov-surface);
  transition: background 0.16s ease;
}

.service-portal-card:hover {
  background: var(--ov-active);
}

.service-portal-card__topline,
.service-portal-card__footer,
.credential-popover__head,
.credential-account__title,
.portal-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-portal-card__type {
  color: #858585;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.service-menu-button {
  display: grid;
  width: 36px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--ov-radius-sm);
  background: transparent;
  color: var(--ov-muted);
  font-size: 22px;
  cursor: pointer;
}

.service-menu-button:hover,
.service-menu-button[aria-expanded="true"] {
  background: var(--ov-active);
  color: var(--ov-accent);
}

.service-portal-card__icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 25px 0 18px;
  place-items: center;
  border: 1px solid var(--ov-border-strong);
  border-radius: 14px;
  background: var(--ov-surface);
  color: var(--ov-accent);
  font-size: 18px;
  font-weight: 500;
}

.service-portal-card h2 {
  margin: 0 0 8px;
  color: var(--ov-accent);
  font-size: 20px;
  font-weight: 500;
}

.service-portal-card > p {
  margin: 0 0 24px;
  color: var(--ov-muted);
  line-height: 1.55;
}

.service-portal-card__footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--ov-border);
}

.portal-status {
  color: var(--ov-muted);
  font-size: 12px;
}

.portal-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #666666;
}

.portal-status.is-active::before {
  background: var(--ov-success-dot);
  box-shadow: 0 0 0 3px var(--ov-success-bg);
}

.portal-status.is-inactive {
  color: #888888;
}

.portal-status.is-inactive::before {
  background: #4b4b4b;
}

.service-open-link {
  color: var(--ov-text);
  font-weight: 500;
  text-decoration: none;
}

.service-open-link:hover {
  color: var(--ov-accent);
}

.credential-popover {
  position: fixed;
  z-index: 110;
  width: min(440px, calc(100vw - 24px));
  max-height: min(640px, calc(100vh - 24px));
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--ov-border-strong);
  border-radius: var(--ov-radius-lg);
  background: var(--ov-surface-raised);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

.credential-popover__head {
  margin-bottom: 14px;
}

.credential-popover__head span {
  display: block;
  color: #858585;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.credential-popover__head strong {
  display: block;
  margin-top: 3px;
  color: var(--ov-accent);
  font-size: 18px;
  font-weight: 500;
}

.credential-popover__close {
  border: 0;
  background: transparent;
  color: var(--ov-muted);
  font-size: 24px;
  cursor: pointer;
}

.credential-accounts {
  display: grid;
  gap: 10px;
}

.credential-account {
  padding: 14px;
  border: 1px solid var(--ov-border-strong);
  border-radius: var(--ov-radius-md);
  background: var(--ov-surface);
}

.credential-account__title {
  align-items: flex-start;
  margin-bottom: 12px;
}

.credential-account__title strong {
  color: var(--ov-accent);
  font-weight: 500;
}

.credential-account__title span,
.credential-account label {
  color: var(--ov-muted);
  font-size: 11px;
}

.credential-account label {
  display: block;
  margin: 10px 0 5px;
  text-transform: uppercase;
}

.credential-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}

.credential-value input {
  min-width: 0;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--ov-border-strong);
  border-radius: var(--ov-radius-sm);
  background: var(--ov-bg);
  color: var(--ov-text);
  font: inherit;
}

.credential-value button,
.credential-copy-all {
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--ov-border-strong);
  border-radius: var(--ov-radius-sm);
  background: var(--ov-active);
  color: var(--ov-text);
  cursor: pointer;
}

.credential-copy-all {
  width: 100%;
  margin-top: 12px;
  border-color: var(--ov-accent);
  background: var(--ov-accent);
  color: var(--ov-accent-text);
}

.credential-account__link {
  display: inline-block;
  margin-top: 10px;
  color: var(--ov-text);
  font-size: 12px;
  text-decoration: none;
}

.portal-empty {
  margin-top: 28px;
  padding: 48px 24px;
  border: 1px dashed var(--ov-border-strong);
  border-radius: var(--ov-radius-lg);
  background: var(--ov-surface);
  color: var(--ov-muted);
  text-align: center;
}

.portal-empty h2 {
  color: var(--ov-accent);
  font-weight: 500;
}

.portal-empty a {
  color: var(--ov-accent);
}

.public-hero {
  display: block;
  min-height: min(620px, calc(100vh - 132px));
  padding-top: clamp(70px, 10vw, 150px);
  border-bottom: 0;
}

.public-hero > div,
.public-hero {
  max-width: none;
}

.public-hero__actions {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}

.public-hero__actions .is-primary {
  border-color: var(--ov-accent);
  background: var(--ov-accent);
  color: var(--ov-accent-text);
}

.portal-tour-launcher {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ov-text);
  cursor: pointer;
}

.portal-tour-launcher:hover {
  background: var(--ov-active);
  color: var(--ov-accent);
}

.portal-tour-launcher svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-tour-backdrop {
  position: fixed;
  z-index: 120;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}

.portal-tour-card {
  position: fixed;
  z-index: 122;
  right: 28px;
  bottom: 28px;
  width: min(430px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--ov-border-strong);
  border-radius: var(--ov-radius-lg);
  background: var(--ov-surface-raised);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.7);
}

.portal-tour-card > span,
.portal-tour-card p {
  color: var(--ov-muted);
}

.portal-tour-card h2 {
  margin: 8px 0;
  color: var(--ov-accent);
  font-weight: 500;
}

.portal-tour-card p {
  line-height: 1.55;
}

.portal-tour-actions {
  margin-top: 20px;
}

.portal-tour-actions button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--ov-border-strong);
  border-radius: 999px;
  background: var(--ov-active);
  color: var(--ov-text);
  cursor: pointer;
}

.portal-tour-actions button:last-child {
  border-color: var(--ov-accent);
  background: var(--ov-accent);
  color: var(--ov-accent-text);
}

.portal-tour-highlight {
  position: relative;
  z-index: 121 !important;
  box-shadow: 0 0 0 2px var(--ov-accent) !important;
}

@media (max-width: 720px) {
  .portal-hero,
  .public-hero {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 24px;
  }

  .portal-manage-link {
    align-self: flex-start;
  }

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

  .service-portal-card {
    min-height: 240px;
  }

  .credential-value {
    grid-template-columns: 1fr 1fr;
  }

  .credential-value input {
    grid-column: 1 / -1;
  }

  .public-hero {
    min-height: auto;
    padding-top: 42px;
  }

  .public-hero__actions {
    width: 100%;
    flex-direction: column;
  }

  .portal-tour-card {
    right: 16px;
    bottom: 16px;
  }
}
