.ffh-directory {
  --ffh-red: #a51d2d;
  --ffh-dark: #292329;
  --ffh-muted: #625c61;
  --ffh-line: #ded9dc;
  color: var(--ffh-dark);
  font-family: inherit;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 0 40px;
  line-height: 1.65;
}
.ffh-directory *, .ffh-directory *::before, .ffh-directory *::after { box-sizing: border-box; }
.ffh-directory a { color: var(--ffh-red); text-decoration: underline; text-underline-offset: 3px; }
.ffh-directory a:hover { color: #751321; }
.ffh-directory :is(a, button, input, select):focus-visible { outline: 3px solid var(--ffh-red); outline-offset: 3px; }
.ffh-directory h1, .ffh-directory h2, .ffh-directory h3 { color: var(--ffh-dark); line-height: 1.4; }
.ffh-directory h2 { margin: 0; font-size: 1.4rem; }
.ffh-filters { padding: 24px; background: #fff; border: 1px solid var(--ffh-line); border-top: 4px solid var(--ffh-red); border-radius: 10px; }
.ffh-directory .ffh-filters label { display: block; font-size: 15px; line-height: 1.5; font-weight: 600; margin-bottom: 7px; }
.ffh-directory .ffh-filters input, .ffh-directory .ffh-filters select { display: block; width: 100%; min-width: 0; max-width: 100%; height: auto; margin: 0; border: 1px solid #aaa0a6; border-radius: 5px; background: #fff; color: var(--ffh-dark); font-family: inherit; font-size: 15px; font-weight: 400; line-height: 1.5; padding: 9px 11px; box-shadow: none; }
.ffh-directory .ffh-filters select[multiple] { appearance: auto; -webkit-appearance: auto; display: block; overflow: auto; height: 150px; min-height: 150px; max-height: 150px; padding: 4px; background-image: none; white-space: normal; }
.ffh-directory .ffh-filters option { display: block; max-width: 100%; font-family: inherit; font-size: 15px; font-weight: 400; line-height: 1.5; padding: 4px 7px; white-space: normal; }
.ffh-filters small, .ffh-help { color: var(--ffh-muted); font-size: .85rem; }
.ffh-search { margin-bottom: 20px; }
.ffh-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ffh-filter-grid > div { min-width: 0; max-width: 100%; }
.ffh-filter-grid select + label { margin-top: 12px; }
.ffh-advanced-filters { margin: 0 0 20px; border-top: 1px solid var(--ffh-line); border-bottom: 1px solid var(--ffh-line); }
.ffh-advanced-filters summary { padding: 14px 0; color: var(--ffh-red); font-weight: 600; cursor: pointer; }
.ffh-advanced-filters summary:focus-visible { outline: 3px solid var(--ffh-red); outline-offset: 3px; }
.ffh-sort-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.ffh-help { margin: 15px 0; }
.ffh-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.ffh-filters .ffh-actions { font-size: 15px; }
.ffh-directory .ffh-button { display: inline-block; background: var(--ffh-red); border: 1px solid var(--ffh-red); border-radius: 5px; padding: 10px 24px; color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.ffh-directory .ffh-button:hover { background: #751321; color: #fff; }
.ffh-result-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 28px 0 18px; }
.ffh-result-heading p { margin: 0; color: var(--ffh-muted); }
.ffh-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ffh-card { background: #fff; border: 1px solid var(--ffh-line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.ffh-portrait { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #f5eff1; }
.ffh-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; margin: 0; }
.ffh-portrait img[hidden] { display: none; }
.ffh-card-body { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.ffh-card h3 { margin: 0 0 5px; font-size: 1.1rem; }
.ffh-card h3 a { text-decoration: none; }
.ffh-name-en { color: var(--ffh-muted); margin: 0 0 12px; font-size: .95rem; overflow-wrap: anywhere; }
.ffh-university { font-weight: 600; margin: 0 0 4px; }
.ffh-organization { color: var(--ffh-muted); margin: 0 0 14px; }
.ffh-expertise { margin: 0 0 10px; font-size: .9rem; }
.ffh-tags { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; margin: 0 0 15px; padding: 0; }
.ffh-tags li { padding: 3px 9px; background: #f9edef; color: #751321; border-radius: 4px; font-size: .8rem; overflow-wrap: anywhere; }
.ffh-detail-link { margin-top: auto; padding-top: 10px; font-weight: 600; }
.ffh-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 30px; }
.ffh-pagination a { padding: 8px 14px; border: 1px solid var(--ffh-line); border-radius: 5px; }
.ffh-profile { display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); gap: 32px; background: #fff; border: 1px solid var(--ffh-line); border-radius: 10px; padding: 28px; margin-top: 20px; }
.ffh-profile .ffh-portrait { border-radius: 6px; }
.ffh-profile h1 { margin: 0 0 8px; font-size: 1.75rem; }
.ffh-profile h2 { font-size: 1.2rem; margin: 25px 0 10px; }
.ffh-contact { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 20px; }
.ffh-contact dt { font-weight: 600; }
.ffh-contact dd { margin: 0; overflow-wrap: anywhere; }
.ffh-text, .ffh-card-body { overflow-wrap: anywhere; }
.ffh-equipment-card .ffh-portrait, .ffh-equipment-profile .ffh-portrait { aspect-ratio: 4 / 3; }
.ffh-equipment-card .ffh-photo, .ffh-equipment-profile .ffh-photo { object-fit: contain; background: #fff; }
.ffh-equipment-summary { color: var(--ffh-muted); font-size: .95rem; margin: 12px 0; }
.ffh-notice, .ffh-empty, .ffh-update-error { background: #fff5f6; border: 1px solid #ddb7be; padding: 20px; border-radius: 6px; }
.ffh-update-error { margin-bottom: 20px; }
.ffh-update-error[hidden] { display: none; }
.ffh-update-error button { font: inherit; color: var(--ffh-red); text-decoration: underline; border: 0; background: transparent; cursor: pointer; padding: 4px 8px; }
.ffh-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ffh-directory[aria-busy="true"] .ffh-result-heading { opacity: .65; }
@media (max-width: 900px) {
  .ffh-cards, .ffh-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ffh-profile { grid-template-columns: minmax(150px, 240px) minmax(0, 1fr); gap: 24px; padding: 20px; }
}
@media (max-width: 600px) {
  .ffh-directory { padding: 16px 0 28px; }
  .ffh-cards, .ffh-filter-grid, .ffh-profile { grid-template-columns: minmax(0, 1fr); }
  .ffh-sort-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ffh-filters { padding: 18px; }
  .ffh-cards { gap: 18px; }
  .ffh-profile .ffh-portrait { width: min(100%, 300px); margin: 0 auto; }
  .ffh-profile h1 { font-size: 1.4rem; }
  .ffh-contact { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .ffh-contact dd { margin-bottom: 10px; }
}
