*, *::before, *::after { box-sizing: border-box; }

:focus-visible { outline: 3px solid var(--link-hover); outline-offset: 3px; }

.portal-page { display: flex; flex-direction: column; }
.portal-shell { flex: 1; padding-block: 14px 32px; }

.portal-heading, .error-page h1 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--outline);
}

.portal-heading h1, .error-page h1 {
  margin-top: 0;
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 900;
  line-height: 1.2;
}

.portal-heading h1 { margin-bottom: 0; }

.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-card {
  display: block;
  height: 100%;
  border: 3px solid var(--outline);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 4px var(--outline);
  color: var(--text);
  text-decoration: none;
}

.service-card:hover { background: var(--surface-soft); }

.service-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 49px;
  padding: 6px 12px;
  border-bottom: 3px solid var(--outline);
  border-radius: 10px 10px 0 0;
  background:
    repeating-linear-gradient(135deg, transparent 0 16px, var(--lane-stripe) 16px 18px),
    var(--surface-soft);
}

.service-title h2 { margin: 0; font-size: 17px; font-weight: 900; overflow-wrap: anywhere; }

.service-icon, .service-arrow {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: none;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #2477dd;
  color: #fff;
  font: 900 18px/1 Arial, sans-serif;
}

.service-icon { transform: rotate(-8deg); }
.service-arrow { margin-inline-start: auto; background: var(--yellow); color: var(--ink); }
.service-card:hover .service-arrow, .return-link:hover { background: #ffef9e; }
.service-info { padding: 12px 14px 15px; }

.service-category {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.service-info p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.portal-footer {
  padding: 14px 0 16px;
  border-top: 4px solid var(--outline);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}

.portal-footer p { margin-block: 0; }

.return-link {
  display: inline-flex;
  gap: 9px;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 2px 3px var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
