/* =========================================================================
   FÖRDERMITTEL-SCANNER — App-specific styles
   Built strictly on OTH colors_and_type.css + styles.css.
   Brand rules: Lucida Sans, ALL-CAPS headlines + eyebrow (tracking .13em),
   square corners (radius 0–2px), no shadows, Hochschulgrau as connector,
   faculty colour only as accent (set via [data-faculty] on <html>).
   ========================================================================= */

/* ----- App layout shell ----------------------------------------------------*/
.pageshell { display: flex; flex-direction: column; min-height: 100vh; background: #fff; }
.fms-main  { flex: 1 0 auto; }

/* Constrain to the OTH content width used by header/footer */
.fms-wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

/* ----- Sub-hero / page intro band -----------------------------------------*/
.fms-hero { background: #000; color: #fff; padding: 48px 0 40px; }
.fms-hero .inner { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.fms-hero .eyebrow { color: var(--accent); display: block; }
.fms-hero h1 { color: #fff; font-size: 44px; line-height: 1.04; margin: 0 0 14px;
  letter-spacing: -.005em; max-width: 22ch; overflow-wrap: break-word; hyphens: auto; }
.fms-hero .accent-bar { height: 6px; width: 72px; background: var(--accent); margin: 0 0 22px; }
.fms-hero .lede { color: #CECECD; font-size: 16px; max-width: 70ch; margin: 0; line-height: 1.55; }
.fms-hero .stamp { display: inline-block; margin-top: 18px; font-size: 11px; letter-spacing: .13em;
  text-transform: uppercase; color: #9D9D9C; }
.fms-hero .stamp strong { color: #fff; font-weight: 700; }

/* ----- Center switch (RCBE / RCHST / Alle) ---------------------------------*/
.center-switch { display: flex; gap: 0; margin: 20px 0 0; flex-wrap: wrap; }
.center-switch a { font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; padding: 10px 18px; text-decoration: none; color: #fff;
  border: 1px solid #444; margin-left: -1px; background: transparent; }
.center-switch a:first-child { margin-left: 0; }
.center-switch a:hover { border-color: #fff; }
.center-switch a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* =========================================================================
   TOOLBAR — filters / search / sort
   ========================================================================= */
.toolbar2 { background: var(--bg-soft); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40; }
.toolbar2 .inner { max-width: 1280px; margin: 0 auto; padding: 16px 32px; }
.toolbar2 .row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld > label { font-size: 10px; letter-spacing: .13em; text-transform: uppercase;
  font-weight: 700; color: #555; }
.fld.grow { flex: 1 1 220px; }
input[type="search"], select.fms {
  font-family: inherit; font-size: 13px; padding: 9px 10px; border: 1px solid var(--border);
  background: #fff; color: #000; border-radius: var(--radius-1); min-width: 0; width: 100%; }
input[type="search"]:focus, select.fms:focus, .chip:focus-visible, .icon-btn:focus-visible,
.callcard a:focus-visible, .prof-nav a:focus-visible, .center-switch a:focus-visible,
.pill-toggle:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }

/* Category / status filter chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: 8px 12px; border: 1px solid var(--border);
  background: #fff; color: #555; cursor: pointer; border-radius: var(--radius-1); }
.chip:hover { border-color: #000; color: #000; }
.chip.active { background: #000; color: #fff; border-color: #000; }
.chip.active.cat-eu       { background: var(--cat-eu); border-color: var(--cat-eu); }
.chip.active.cat-bund     { background: var(--cat-bund); border-color: var(--cat-bund); }
.chip.active.cat-bayern   { background: var(--cat-bayern); border-color: var(--cat-bayern); }
.chip.active.cat-stiftung { background: var(--cat-stiftung); border-color: var(--cat-stiftung); }

.pill-toggle { font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: 8px 12px; border: 1px solid var(--border);
  background: #fff; color: #555; cursor: pointer; border-radius: var(--radius-1);
  display: inline-flex; align-items: center; gap: 6px; }
.pill-toggle.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.pill-toggle:hover { border-color: #000; }
.pill-toggle.on:hover { border-color: var(--accent); }

.toolbar2 .meta-row { display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; gap: 16px; flex-wrap: wrap; }
.result-count { font-size: 12px; letter-spacing: .05em; color: #555; text-transform: uppercase; }
.result-count strong { color: #000; }
.btn-reset { background: none; border: 0; font-family: inherit; font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase; color: #555; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; }
.btn-reset:hover { color: #000; }

/* =========================================================================
   CATEGORY COLOR MAP — neutral, faculty-accent stays separate
   These are deliberately desaturated so the faculty accent stays dominant.
   ========================================================================= */
:root {
  --cat-eu:       #164194;  /* IM blue – EU */
  --cat-bund:     #000000;  /* black – Bund */
  --cat-bayern:   #009BAC;  /* M teal – Bayern */
  --cat-stiftung: #831F82;  /* EI violet – Stiftung */
}

/* =========================================================================
   LAYOUT WITH SIDEBAR (professorship navigation)
   ========================================================================= */
.fms-layout { display: grid; grid-template-columns: 248px 1fr; gap: 40px;
  max-width: 1280px; margin: 0 auto; padding: 40px 32px 0; align-items: start; }
.fms-layout.no-side { grid-template-columns: 1fr; }

.prof-nav { position: sticky; top: 150px; align-self: start; }
.prof-nav h3 { font-size: 12px; letter-spacing: .13em; text-transform: uppercase;
  color: #555; margin: 0 0 12px; font-weight: 700; }
.prof-nav ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.prof-nav li { margin-left: -1px; border-left: 3px solid transparent; }
.prof-nav li.active { border-left-color: var(--accent); }
.prof-nav a { display: block; padding: 8px 0 8px 14px; font-size: 12.5px; line-height: 1.35;
  text-decoration: none; color: #555; }
.prof-nav a:hover { color: #000; }
.prof-nav li.active a { color: #000; font-weight: 700; }
.prof-nav a .field { display: block; font-size: 10.5px; color: #9D9D9C; letter-spacing: .04em;
  text-transform: uppercase; margin-top: 2px; font-weight: 400; }
.prof-nav a .cnt { float: right; font-size: 10px; color: #9D9D9C; font-variant-numeric: tabular-nums; }

/* =========================================================================
   CALL CARDS
   ========================================================================= */
.calls-list { display: flex; flex-direction: column; gap: 18px; padding-bottom: 64px; }

.callcard { border: 1px solid var(--border); background: #fff; position: relative;
  transition: border-color .15s ease; }
.callcard:hover { border-color: #000; }
.callcard.is-hidden { opacity: .5; }
.callcard.is-starred { border-left: 4px solid var(--accent); }

.callcard .cc-top { display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 24px 0; }
.callcard .cc-main { flex: 1; min-width: 0; }
.callcard .cc-badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 10px; }

/* Category badge */
.badge { font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  padding: 4px 9px; border-radius: var(--radius-1); color: #fff; white-space: nowrap; }
.badge.cat-eu       { background: var(--cat-eu); }
.badge.cat-bund     { background: var(--cat-bund); }
.badge.cat-bayern   { background: var(--cat-bayern); }
.badge.cat-stiftung { background: var(--cat-stiftung); }

.badge.status { background: var(--oth-grey-25); color: #000; }
.badge.status.open       { background: var(--fak-sg); color: #fff; }
.badge.status.forthcoming{ background: var(--fak-b); color: #000; }
.badge.status.closed     { background: var(--oth-grey); color: #fff; }

.badge.neu { background: var(--accent); color: #fff; }

/* Center pills */
.center-pill { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--radius-1); color: #555; }

.callcard h3 { font-size: 19px; line-height: 1.2; margin: 0 0 8px; text-transform: uppercase;
  letter-spacing: 0; }
.callcard h3 a { color: #000; text-decoration: none; }
.callcard h3 a:hover { color: var(--accent); }

.callcard .programme { font-size: 12px; color: #555; margin: 0 0 12px;
  letter-spacing: .03em; }
.callcard .programme strong { color: #000; font-weight: 700; }

.callcard .summary { font-size: 14px; line-height: 1.55; color: #222; margin: 0 0 14px;
  max-width: none; }

/* Deadline block with urgency cue */
.cc-meta { display: flex; gap: 28px; flex-wrap: wrap; padding: 0 24px 16px;
  font-size: 12px; }
.cc-meta .m { display: flex; flex-direction: column; gap: 3px; }
.cc-meta .m .k { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: #9D9D9C; }
.cc-meta .m .v { font-weight: 700; font-variant-numeric: tabular-nums; color: #000; }
.cc-meta .m .v.amount { font-weight: 400; }

.deadline-tag { display: inline-flex; align-items: center; gap: 7px; font-weight: 700;
  font-variant-numeric: tabular-nums; }
.deadline-tag .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--oth-grey); }
.deadline-tag.urgent      { color: var(--fak-bm); }
.deadline-tag.urgent .dot { background: var(--fak-bm); }
.deadline-tag.soon        { color: var(--fak-b); }
.deadline-tag.soon .dot   { background: var(--fak-b); }
.deadline-tag.ok .dot     { background: var(--fak-sg); }
.deadline-tag .rel { font-weight: 400; color: #555; letter-spacing: .03em; }

/* Theme chips */
.themes { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 24px 16px; }
.theme-chip { font-size: 11px; letter-spacing: .04em; color: #555; background: var(--bg-soft);
  border: 1px solid var(--border); padding: 3px 9px; border-radius: var(--radius-1); }

/* Matched professorships */
.cc-matches { border-top: 1px solid var(--border); padding: 14px 24px;
  background: #fcfcfb; }
.cc-matches .mh { font-size: 10px; letter-spacing: .13em; text-transform: uppercase;
  color: #9D9D9C; font-weight: 700; margin-bottom: 10px; }
.match-row { display: grid; grid-template-columns: 16px 180px 1fr; gap: 12px; align-items: baseline;
  padding: 5px 0; font-size: 13px; }
.match-row + .match-row { border-top: 1px dotted var(--border); }
.match-row .score-bar { grid-column: 1 / -1; }
.match-name { font-weight: 700; }
.match-name a { color: #000; text-decoration: none; }
.match-name a:hover { color: var(--accent); text-decoration: underline; }
.match-reason { color: #555; line-height: 1.4; }
.score { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.score .track { width: 54px; height: 6px; background: var(--oth-grey-25); position: relative; }
.score .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
.score .num { font-size: 11px; font-weight: 700; color: #000; min-width: 28px; }
.match-grid { display: grid; grid-template-columns: 1fr; gap: 0; }

/* Card actions (star / hide / note / link) */
.cc-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--border); background: #fff;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-1); color: #555; padding: 0; }
.icon-btn:hover { border-color: #000; color: #000; }
.icon-btn.on { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

.cc-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  border-top: 1px solid var(--border); padding: 14px 24px; flex-wrap: wrap; }
.cc-foot .source-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: #9D9D9C; }
.cc-foot .orig-link { font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: #000; text-decoration: none; display: inline-flex;
  align-items: center; gap: 8px; border: 2px solid #000; padding: 9px 14px; }
.cc-foot .orig-link:hover { background: #000; color: #fff; }
.cc-foot .orig-link svg { width: 13px; height: 13px; }

/* Note editor */
.cc-note { padding: 0 24px 16px; }
.cc-note textarea { width: 100%; font-family: inherit; font-size: 13px; line-height: 1.5;
  border: 1px solid var(--border); padding: 10px; resize: vertical; min-height: 60px;
  border-radius: var(--radius-1); background: #fffef8; }
.cc-note textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.note-indicator { color: var(--accent); }

/* =========================================================================
   EMPTY / LOADING / ERROR STATES
   ========================================================================= */
.state-box { text-align: center; padding: 80px 24px; color: #555; }
.state-box .stamp { display: inline-block; padding: 8px 14px; background: #000; color: #fff;
  font-size: 11px; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 18px; }
.state-box h4 { font-size: 18px; margin: 0 0 8px; }
.state-box p { font-size: 13px; max-width: 50ch; margin: 0 auto; }

.skeleton { border: 1px solid var(--border); height: 180px; position: relative; overflow: hidden;
  background: var(--bg-soft); }
.skeleton::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* =========================================================================
   PROFESSORSHIP DETAIL HEADER
   ========================================================================= */
.prof-head { border-bottom: 2px solid #000; padding-bottom: 18px; margin-bottom: 24px; }
.prof-head .eyebrow { color: var(--accent); }
.prof-head h2 { font-size: 30px; margin: 0 0 6px; letter-spacing: 0; }
.prof-head .field { font-size: 14px; color: #555; margin: 0 0 12px; }
.prof-head .kw { display: flex; gap: 6px; flex-wrap: wrap; }
.prof-head .kw .theme-chip { background: #fff; }
.prof-head .centers-line { font-size: 12px; color: #555; margin-top: 10px; letter-spacing: .05em; }

/* Data source footer line */
.data-foot { font-size: 11px; color: #9D9D9C; letter-spacing: .05em; padding: 6px 0 0;
  text-align: right; }
.data-foot.fallback { color: var(--fak-bm); }

/* Sources legend (Gesamtübersicht) */
.sources-strip { border-top: 1px solid var(--border); margin-top: 8px; padding: 16px 0 0;
  display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: #9D9D9C; letter-spacing: .05em; }
.sources-strip .src { display: inline-flex; align-items: center; gap: 6px; }
.sources-strip .src .swatch { width: 10px; height: 10px; border-radius: var(--radius-1); }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 1024px) {
  .fms-wrap, .toolbar2 .inner, .fms-hero .inner { padding-left: 24px; padding-right: 24px; }
  .fms-layout { grid-template-columns: 200px 1fr; gap: 28px; padding: 32px 24px 0; }
  .fms-hero h1 { font-size: 36px; }
}
@media (max-width: 768px) {
  .toolbar2 { position: static; }
  .toolbar2 .inner { padding: 14px 20px; }
  .fms-hero { padding: 36px 0 32px; }
  .fms-hero .inner { padding: 0 20px; }
  .fms-hero h1 { font-size: 30px; }
  .fms-layout { grid-template-columns: 1fr; gap: 20px; padding: 24px 20px 0; }
  .prof-nav { position: static; }
  .prof-nav ul { display: flex; flex-wrap: wrap; gap: 4px; border-left: 0; }
  .prof-nav li { border-left: 0; border-bottom: 3px solid transparent; margin-left: 0; }
  .prof-nav li.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .prof-nav a { padding: 6px 10px; }
  .prof-nav a .field, .prof-nav a .cnt { display: none; }
  .match-row { grid-template-columns: 1fr; gap: 2px; }
  .cc-meta { gap: 18px; }
  .center-switch { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .fms-wrap, .toolbar2 .inner, .fms-hero .inner, .fms-layout { padding-left: 16px; padding-right: 16px; }
  .fms-hero h1 { font-size: 24px; }
  .callcard .cc-top { padding: 16px 16px 0; }
  .cc-meta, .themes, .cc-matches, .cc-foot, .cc-note { padding-left: 16px; padding-right: 16px; }
  .callcard h3 { font-size: 16px; }
  .cc-foot .orig-link { width: 100%; justify-content: center; }
  .fld.grow { flex-basis: 100%; }
}
