/* ==========================================================================
   aaimk — SimpleSAMLphp 2.x theme for the AAI.mk eduGAIN proxy
   Loaded after the stock stylesheet.css, so rules here override it.

   Palette and geometry match the aai_mk CAS theme and the aai-mk Keycloak
   theme: ink #14262b, teal #00899b / #00616e, pink #ed5b83, mist #eef4f5.
   ========================================================================== */
:root {
  --aai-ink:          #14262b;
  --aai-muted:        #5c6b70;
  --aai-line:         #d9e3e5;
  --aai-field:        #bccbce;
  --aai-field-hover:  #9fb3b7;
  --aai-paper:        #ffffff;
  --aai-mist:         #eef4f5;
  --aai-wash:         #fafcfc;
  --aai-hover:        #f5fbfc;
  --aai-teal:         #00899b;
  --aai-teal-deep:    #00616e;
  --aai-teal-dark:    #004e58;
  --aai-teal-tint:    #e3f2f4;
  --aai-pink:         #ed5b83;
  --aai-danger:       #b4234f;
  --aai-danger-ink:   #7a2740;
  --aai-danger-bg:    #fff4f7;
  --aai-danger-line:  #efb7c6;
  --aai-warning-ink:  #674d12;
  --aai-warning-bg:   #fff9e9;
  --aai-warning-line: #e8d29c;
  --aai-info-ink:     #145967;
  --aai-info-bg:      #f0fafb;
  --aai-info-line:    #abdce2;
  --aai-success-ink:  #235d46;
  --aai-success-bg:   #f1faf6;
  --aai-success-line: #b7ddcc;

  --aai-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --aai-mono-font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --aai-radius-lg: 18px;
  --aai-radius-sm: 12px;
  --aai-radius-field: 10px;
  --aai-shadow-card: 0 1px 2px rgba(20,38,43,.04), 0 18px 48px -18px rgba(0,97,110,.22);
  --aai-shadow-focus: 0 0 0 3px rgba(0,137,155,.14);
  --aai-gradient: linear-gradient(90deg, var(--aai-pink), #b86aa0 30%, var(--aai-teal) 70%);
}

/* ==========================================================================
   PAGE FRAME
   ========================================================================== */
html, body { height: auto; }
body.aai-page-body {
  margin: 0;
  min-height: 100vh;
  background: var(--aai-mist);
  color: var(--aai-ink);
  font-family: var(--aai-font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.aai-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
.aai-shell {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}
.aai-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 52px 16px 64px;
}

/* The stock stylesheet paints every hovered or focused link dark grey
   (a:hover, a:focus { background-color:#444; color:#fff }). That showed as a
   black bar on an institution row after going back to the page, because the
   browser restores focus to the clicked row; it also hit hovered tabs and the
   header logo. Neutralise it for the whole page: each component below sets
   its own hover and keyboard-focus look with more specific rules. */
.aai-page a:hover,
.aai-page a:focus {
  background-color: transparent;
}

.aai-skip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 200;
  padding: 8px 14px;
  border-radius: 0 0 var(--aai-radius-field) 0;
  background: var(--aai-teal-deep);
  color: #fff !important;
  font-size: .9rem;
  font-weight: 600;
  transform: translateY(-120%);
}
.aai-page .aai-skip:focus { transform: none; padding: 8px 14px; background: var(--aai-teal-deep); }

/* ==========================================================================
   HEADER — white band, centred EOSC Node logo, language menu on the right
   ========================================================================== */
.aai-header {
  background: var(--aai-paper);
  border-bottom: 1px solid var(--aai-line);
}
.aai-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}
.aai-brand,
.aai-brand:hover,
.aai-brand:focus { display: block; line-height: 0; padding: 0; }
.aai-brand img {
  display: block;
  height: 54px;
  width: auto;
}

.aai-lang {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.aai-lang summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 11px;
  border: 1px solid var(--aai-line);
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--aai-ink);
  background: var(--aai-paper);
  user-select: none;
}
.aai-lang summary::-webkit-details-marker { display: none; }
.aai-lang summary:hover { border-color: #b9c9cc; }
.aai-lang summary:focus-visible { outline: 2px solid var(--aai-teal); outline-offset: 2px; }
.aai-lang summary svg { width: 16px; height: 16px; color: var(--aai-muted); }
.aai-lang summary .aai-chev { width: 14px; height: 14px; transition: transform .15s ease; }
.aai-lang[open] summary { border-color: var(--aai-teal); }
.aai-lang[open] summary .aai-chev { transform: rotate(180deg); }
.aai-lang-short { display: none; }
.aai-lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 100;
  min-width: 170px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--aai-paper);
  border: 1px solid var(--aai-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px -12px rgba(20,38,43,.28);
}
.aai-lang-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--aai-ink);
  font-size: .9rem;
  text-decoration: none;
}
.aai-lang-menu a:hover,
.aai-lang-menu a:focus { padding: 8px 12px; background: var(--aai-hover); color: var(--aai-teal-deep); }
.aai-lang-menu a[aria-current="true"] { color: var(--aai-teal-deep); font-weight: 650; }

/* ==========================================================================
   CARD
   ========================================================================== */
.aai-card {
  position: relative;
  width: min(560px, 100%);
  background: var(--aai-paper);
  border: 1px solid var(--aai-line);
  border-radius: var(--aai-radius-lg);
  box-shadow: var(--aai-shadow-card);
  overflow: hidden;
}
.aai-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--aai-gradient);
}
.aai-card--disco { width: min(640px, 100%); }

/* The stock #content / .wrap rules are neutralised inside the card. */
.aai-card #content.aai-card-body {
  padding: 34px 34px 28px;
}
.aai-card #content .wrap {
  width: auto;
  max-width: none;
  margin: 0;
}

/* ---- typography inside the card (all SimpleSAMLphp pages) ---- */
.aai-card-body h1,
.aai-card-body h2 {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: var(--aai-ink);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.aai-card-body h2 ~ h2,
.aai-card-body h1 ~ h2 {
  margin-top: 28px;
  font-size: 1.1rem;
  font-weight: 650;
}
.aai-card-body h3 { margin: 22px 0 8px; font-size: 1rem; font-weight: 650; color: var(--aai-ink); }
.aai-card-body p { margin: 0 0 14px; padding: 0; color: var(--aai-ink); }
.aai-card-body ul,
.aai-card-body ol { margin: 0 0 14px; padding-left: 1.3em; }
.aai-card-body ul { list-style: disc; }
.aai-card-body ol { list-style: decimal; }
.aai-card-body li { margin: 4px 0; }
.aai-card-body a {
  color: var(--aai-teal-deep);
  text-underline-offset: 2px;
}
.aai-card-body a:hover { color: var(--aai-teal-dark); }
.aai-card-body a:hover,
.aai-card-body a:focus { padding: 0; }
.aai-card-body :focus-visible {
  outline: 2px solid var(--aai-teal);
  outline-offset: 2px;
}
.aai-card-body pre,
.aai-card-body code,
.aai-card-body tt {
  font-family: var(--aai-mono-font);
  font-size: .85rem;
}
.aai-card-body pre {
  overflow: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- header block of a card ---- */
.aai-head { margin-bottom: 22px; }
.aai-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px !important;
  padding: 4px 11px 4px 9px !important;
  border-radius: 999px;
  background: var(--aai-teal-tint);
  color: var(--aai-teal-deep) !important;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .02em;
}
.aai-eyebrow svg { width: 16px; height: 16px; }
.aai-head h1 { margin-bottom: 6px; }
.aai-subtitle { margin: 0 !important; color: var(--aai-muted) !important; font-size: .98rem; }

/* ---- card foot note ---- */
.aai-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 14px 34px 16px;
  border-top: 1px solid var(--aai-line);
  background: var(--aai-wash);
  color: var(--aai-muted);
  font-size: .84rem;
  line-height: 1.5;
}
.aai-note svg { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; color: var(--aai-teal-deep); }

/* ==========================================================================
   BUTTONS AND FORMS (shared with the stock pure-* classes)
   ========================================================================== */
.aai-btn,
.aai-card-body .pure-button-primary,
.aai-card-body .pure-button-red,
.aai-card-body input[type="submit"],
.aai-card-body button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid var(--aai-teal-deep);
  border-radius: var(--aai-radius-field);
  background: var(--aai-teal-deep);
  color: #fff;
  font: inherit;
  font-weight: 650;
  line-height: 1.25;
  text-shadow: none;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
.aai-btn:hover,
.aai-card-body .pure-button-primary:hover,
.aai-card-body .pure-button-red:hover,
.aai-card-body input[type="submit"]:hover,
.aai-card-body button[type="submit"]:hover {
  border-color: var(--aai-teal-dark);
  background: var(--aai-teal-dark);
  background-image: none;
}
.aai-card-body .pure-button:not(.pure-button-primary):not(.pure-button-red):not([type="submit"]) {
  border: 1px solid var(--aai-field);
  border-radius: var(--aai-radius-field);
  background: var(--aai-paper);
  color: var(--aai-ink);
  box-shadow: none;
}
.aai-card-body .pure-button:not(.pure-button-primary):not(.pure-button-red):not([type="submit"]):hover {
  border-color: var(--aai-teal);
  background: var(--aai-hover);
  background-image: none;
  color: var(--aai-teal-deep);
}

.aai-card-body input[type="text"],
.aai-card-body input[type="search"],
.aai-card-body input[type="email"],
.aai-card-body input[type="password"],
.aai-card-body input[type="url"],
.aai-card-body select,
.aai-card-body textarea {
  box-sizing: border-box;
  max-width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--aai-field);
  border-radius: var(--aai-radius-field);
  background: var(--aai-paper);
  color: var(--aai-ink);
  font: inherit;
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.aai-card-body input:hover,
.aai-card-body select:hover,
.aai-card-body textarea:hover { border-color: var(--aai-field-hover); }
.aai-card-body input:focus,
.aai-card-body select:focus,
.aai-card-body textarea:focus {
  outline: none;
  border-color: var(--aai-teal);
  box-shadow: var(--aai-shadow-focus);
}
.aai-card-body textarea { width: 100%; margin: 10px 0; }
.aai-card-body label { color: var(--aai-ink); font-size: .92rem; font-weight: 600; }

.aai-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 500 !important;
  cursor: pointer;
}
.aai-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--aai-teal-deep);
}

/* ---- stock message boxes (errors, warnings) ---- */
.aai-card-body .message-box {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid var(--aai-info-line);
  border-radius: var(--aai-radius-sm);
  background: var(--aai-info-bg);
  color: var(--aai-info-ink);
}
.aai-card-body .message-box p { color: inherit; font-size: .92rem; }
.aai-card-body .message-box.error {
  border-color: var(--aai-danger-line);
  background: var(--aai-danger-bg);
  color: var(--aai-danger-ink);
}
.aai-card-body .message-box.warning {
  border-color: var(--aai-warning-line);
  background: var(--aai-warning-bg);
  color: var(--aai-warning-ink);
}
.aai-card-body .message-box.success {
  border-color: var(--aai-success-line);
  background: var(--aai-success-bg);
  color: var(--aai-success-ink);
}
.aai-card-body .pure-button-group.two-elements {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.aai-card-body .pure-button-group .pure-button.hollow {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  border-radius: var(--aai-radius-field) 0 0 var(--aai-radius-field) !important;
  opacity: 1;
  cursor: text;
  user-select: all;
}
.aai-card-body .pure-button-group .clipboard-btn {
  border-left: 0 !important;
  border-radius: 0 var(--aai-radius-field) var(--aai-radius-field) 0 !important;
}
.aai-card-body #trackid { font-size: .95rem; color: var(--aai-ink); }
.aai-card-body .code-box {
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--aai-line);
  border-radius: var(--aai-radius-sm);
  background: var(--aai-wash);
}

/* ---- stock tables ---- */
.aai-card-body table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.aai-card-body th,
.aai-card-body td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--aai-line);
  text-align: left;
  vertical-align: top;
}
.aai-card-body th { color: var(--aai-muted); font-weight: 600; }

/* Pages that need more room (admin, metadata, status) */
#content:has(table.attributes),
#content:has(.code-box),
#content:has(#portalmenu) { overflow-x: auto; }
.aai-card:has(table.attributes),
.aai-card:has(#portalmenu),
.aai-card:has(pre#xmlmetadata) { width: min(960px, 100%); }

/* ==========================================================================
   DISCOVERY (discopower)
   ========================================================================== */

/* jQuery UI's live region for the tooltip; the jQuery UI theme is not loaded */
.ui-helper-hidden-accessible {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}
.ui-tooltip {
  position: absolute;
  z-index: 300;
  max-width: 300px;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--aai-ink);
  color: #fff;
  font-size: .82rem;
  line-height: 1.45;
  box-shadow: 0 10px 24px -10px rgba(20,38,43,.5);
}

/* ---- favourite (remembered) institution ---- */
.aai-fav { margin: 0 0 22px; }
.aai-fav-label {
  margin: 0 0 8px !important;
  color: var(--aai-muted) !important;
  font-size: .84rem;
  font-weight: 600;
}
.aai-fav-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--aai-teal);
  border-radius: var(--aai-radius-sm);
  background: var(--aai-hover);
}
.aai-fav-entity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.aai-fav-form .aai-btn { width: 100%; white-space: normal; text-align: center; }
.aai-fav-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 0 !important;
  color: var(--aai-muted) !important;
  font-size: .82rem;
}
.aai-fav-or::before,
.aai-fav-or::after { content: ""; flex: 1; height: 1px; background: var(--aai-line); }

/* ---- tabs (jQuery UI tabs on #tabdiv) ---- */
.aai-disco.ui-tabs { padding: 0; border: 0; background: none; }
.aai-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 16px !important;
  padding: 4px !important;
  list-style: none !important;
  border: 1px solid var(--aai-line);
  border-radius: 12px;
  background: var(--aai-mist);
}
.aai-tabs li {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  background: none;
  border: 0;
}
.aai-tabs li a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px !important;
  border-radius: 9px;
  color: var(--aai-muted) !important;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  outline: none;
  transition: background-color .15s, color .15s;
}
.aai-tabs li a > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.aai-tabs li a:hover { color: var(--aai-ink) !important; }
.aai-tabs li a:focus-visible { box-shadow: 0 0 0 2px var(--aai-teal); }
.aai-tabs li.ui-tabs-active a,
.aai-tabs li[aria-selected="true"] a {
  background: var(--aai-paper);
  color: var(--aai-teal-deep) !important;
  box-shadow: 0 1px 2px rgba(20,38,43,.08), 0 0 0 1px var(--aai-line);
}
.aai-tab-count {
  min-width: 1.6em;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(20,38,43,.07);
  color: inherit;
  font-size: .74rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.aai-tabs li.ui-tabs-active .aai-tab-count,
.aai-tabs li[aria-selected="true"] .aai-tab-count { background: var(--aai-teal-tint); }

/* Without JavaScript only the first panel shows, as in stock discopower. */
.aai-panel { display: none; padding: 0; border: 0; background: none; }
.aai-panel.current { display: block; }
.ui-tabs .aai-panel { display: block; }
.ui-tabs .aai-panel[aria-hidden="true"] { display: none; }

/* ---- search ---- */
.aai-search { position: relative; float: none; margin: 0; }
.aai-search form { display: block; margin: 0; }
.aai-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 19px;
  height: 19px;
  color: var(--aai-muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.aai-card-body .aai-search input.inlinesearch {
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 12px 14px 12px 44px;
  border-color: var(--aai-field);
  font-size: 1rem;
}
.aai-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-left: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%2300616e'/%3E%3Cpath d='M8.5 8.5l7 7M15.5 8.5l-7 7' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 18px no-repeat;
  cursor: pointer;
}

.aai-count {
  margin: 10px 2px 8px !important;
  color: var(--aai-muted) !important;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

/* ---- institution list ---- */
.aai-list {
  clear: both;
  display: flex;
  flex-direction: column;
  max-height: min(52vh, 460px);
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--aai-line);
  border-radius: var(--aai-radius-sm);
  background: var(--aai-paper);
  scrollbar-width: thin;
  scrollbar-color: var(--aai-field) transparent;
}
.aai-list:has(> .aai-entry:only-child),
.aai-list[data-empty="true"] { max-height: none; }
.aai-list[data-empty="true"] { display: none; }
.aai-list > a.aai-entry { flex: 0 0 auto; }

.aai-card-body a.aai-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--aai-ink);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .12s;
  /* thousands of eduGAIN rows: let the browser skip off-screen layout */
  content-visibility: auto;
  contain-intrinsic-size: auto 58px;
}
.aai-card-body a.aai-entry { box-shadow: 0 1px 0 var(--aai-line); }
.aai-card-body a.aai-entry:hover,
.aai-card-body a.aai-entry:focus-visible {
  padding: 10px 12px;
  background: var(--aai-hover);
  color: var(--aai-ink);
}
.aai-card-body a.aai-entry:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--aai-teal);
}
.aai-card-body a.aai-entry:hover { box-shadow: none; }

.aai-mono,
.aai-logo {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 9px;
}
.aai-mono {
  display: grid;
  place-items: center;
  background: var(--aai-teal-tint);
  color: var(--aai-teal-deep);
  font-size: .95rem;
  font-weight: 700;
}
.aai-mono::before { content: attr(data-initial); }
.aai-logo {
  display: block;
  box-sizing: border-box;
  object-fit: contain;
  padding: 2px;
  border: 1px solid var(--aai-line);
  background: #fff;
}
.aai-entry-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.aai-entry-text strong {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.aai-entry-text small {
  margin-top: 1px;
  color: var(--aai-muted);
  font-size: .8rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Chevron, drawn here rather than as an SVG in each of the thousands of rows */
.aai-card-body a.aai-entry::after {
  content: "";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  background: var(--aai-field-hover);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.5 4.5 13 10l-5.5 5.5'/%3E%3C/svg%3E") center / 18px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.5 4.5 13 10l-5.5 5.5'/%3E%3C/svg%3E") center / 18px no-repeat;
  transition: background-color .12s, transform .12s;
}
.aai-card-body a.aai-entry:hover::after,
.aai-card-body a.aai-entry:focus-visible::after { background: var(--aai-teal-deep); transform: translateX(2px); }

.aai-card-body a.aai-entry[hidden] { display: none; }
/* While searching, the first match is what Enter opens. */
.aai-card-body a.aai-entry.aai-first { background: var(--aai-hover); }
.aai-card-body a.aai-entry.aai-first::after { background: var(--aai-teal-deep); }

.aai-entry.favourite .aai-mono { background: var(--aai-teal-deep); color: #fff; }

/* ---- empty search result ---- */
.aai-empty {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: start;
  padding: 18px;
  border: 1px dashed var(--aai-field);
  border-radius: var(--aai-radius-sm);
  background: var(--aai-wash);
}
.aai-empty[hidden] { display: none; }
.aai-empty svg { width: 22px; height: 22px; color: var(--aai-muted); }
.aai-empty p { margin: 0 !important; color: var(--aai-muted) !important; font-size: .9rem; }
.aai-empty strong { display: block; margin-bottom: 2px; color: var(--aai-ink); }
.aai-empty .aai-btn { grid-column: 2; justify-self: start; margin-top: 10px; }

.aai-btn.aai-btn-secondary {
  min-height: 40px;
  padding: 8px 16px;
  border-color: var(--aai-teal);
  background: var(--aai-paper);
  color: var(--aai-teal-deep);
  font-size: .9rem;
}
.aai-btn.aai-btn-secondary:hover {
  border-color: var(--aai-teal-deep);
  background: var(--aai-hover);
  color: var(--aai-teal-dark);
}

/* ==========================================================================
   FOOTER — partner logos and colophon (white band, as in CAS)
   ========================================================================== */
.aai-footer {
  background: var(--aai-paper);
  border-top: 1px solid var(--aai-line);
}
.aai-partners {
  list-style: none;
  margin: 0;
  padding: 34px 0 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 26px 52px;
}
.aai-partners li { display: flex; align-items: center; }
.aai-partners img {
  display: block;
  width: auto;
  height: var(--h);
  object-fit: contain;
}
/* Logo heights (SimpleSAMLphp's CSP blocks inline style attributes). */
.aai-h40 { --h: 40px; }
.aai-h42 { --h: 42px; }
.aai-h46 { --h: 46px; }
.aai-h50 { --h: 50px; }
.aai-h56 { --h: 56px; }
.aai-h60 { --h: 60px; }
.aai-footer-bottom {
  border-top: 1px solid var(--aai-line);
  padding: 16px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px 24px;
  flex-wrap: wrap;
}
.aai-footer-copy {
  margin: 0;
  padding: 0;
  color: var(--aai-muted);
  font-size: .82rem;
}
.aai-footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.aai-footer-links a {
  color: var(--aai-muted);
  font-size: .82rem;
  text-decoration: none;
}
.aai-footer-links a:hover,
.aai-footer-links a:focus {
  padding: 0;
  background: none;
  color: var(--aai-teal-deep);
  text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .aai-partners { gap: 26px 40px; }
  .aai-partners img { height: calc(var(--h) * .85); }
}
@media (max-width: 560px) {
  .aai-shell { width: calc(100% - 32px); }
  .aai-header-inner {
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
  }
  .aai-brand { min-width: 0; }
  .aai-brand img { width: 100%; height: auto; max-width: 230px; }
  .aai-lang { position: static; transform: none; flex: 0 0 auto; }
  .aai-lang-full { display: none; }
  .aai-lang-short { display: inline; }

  .aai-main { padding: 22px 12px 36px; }
  .aai-card #content.aai-card-body { padding: 26px 20px 22px; }
  .aai-card-body h1,
  .aai-card-body h2 { font-size: 1.45rem; }
  .aai-note { padding: 13px 20px 15px; }

  .aai-tabs li a { padding: 8px 10px !important; font-size: .88rem; }
  .aai-tab-count { display: none; }
  .aai-list { max-height: 58vh; }
  .aai-card-body a.aai-entry,
  .aai-card-body a.aai-entry:hover,
  .aai-card-body a.aai-entry:focus-visible { padding: 10px; gap: 11px; }

  .aai-partners { padding: 26px 0 22px; gap: 22px 28px; }
  .aai-partners img { height: calc(var(--h) * .8); }
  .aai-footer-bottom { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media (forced-colors: active) {
  .aai-card::before { background: CanvasText; }
  .aai-card-body a.aai-entry:focus-visible { outline: 2px solid Highlight; }
}
