/* app/assets/stylesheets/application.css — kompletter Inhalt ersetzen */
:root {
  --bg: #EFF3EA; --ink: #22301F; --muted: #647159; --faint: #8C9C80;
  --line: #D8E1CE; --accent: #2E6141; --accent-dark: #234D32;
  --chip: #E2EAD8; --card: #FFFFFF; --divider: #E6EDDD;
  --warn-bg: #F4ECDA; --warn-fg: #7A5A22; --danger-bg: #F5E4E0; --danger-fg: #8E3423;
  --serif: 'Newsreader', serif; --sans: 'IBM Plex Sans', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
input, select, textarea, button { font-family: var(--sans); }
::placeholder { color: #9CAA92; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hd-nav { display: flex; align-items: center; gap: 24px; padding: 0 clamp(16px, 4vw, 40px);
  height: 60px; background: var(--bg); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; }
.hd-nav__brand { font-family: var(--serif); font-size: 23px; font-weight: 600;
  letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.hd-nav__brand span { color: var(--accent); }
.hd-nav__links { display: flex; gap: 4px; flex: 1; }
.hd-nav__link { padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--muted); text-decoration: none; }
.hd-nav__link:hover { background: var(--chip); }
.hd-nav__link--active { color: var(--ink); background: var(--chip); }
.hd-main { max-width: 1120px; margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 40px) 80px; animation: rise 0.35s ease; }

h1, .hd-h1 { font-family: var(--serif); font-size: clamp(28px, 4vw, 38px);
  font-weight: 500; letter-spacing: -0.02em; margin: 0; }
.hd-sub { color: var(--muted); margin-top: 4px; font-size: 14px; }
.hd-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint); margin: 36px 0 12px; }

.hd-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.hd-card--link { cursor: pointer; transition: border-color 0.15s, transform 0.15s;
  text-decoration: none; color: inherit; display: block; overflow: hidden; }
.hd-card--link:hover { border-color: var(--accent); transform: translateY(-2px); }

.hd-btn { display: inline-block; border: none; background: var(--accent); color: #F7FAF3;
  font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 9px;
  cursor: pointer; text-decoration: none; }
.hd-btn:hover { background: var(--accent-dark); }
.hd-btn--secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.hd-btn--secondary:hover { background: var(--card); border-color: var(--accent); color: var(--accent); }

.hd-chip { display: inline-flex; padding: 6px 12px; border-radius: 99px; font-size: 12.5px;
  font-weight: 500; border: 1px solid var(--line); background: var(--card); color: #586550; }
.hd-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink);
  color: var(--bg); display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; }

.hd-flash { border-radius: 12px; padding: 12px 18px; margin-bottom: 16px; font-size: 14px; }
.hd-flash--notice { background: #DEEBD8; color: var(--accent-dark); border: 1px solid #B9D0AC; }
.hd-flash--alert { background: var(--danger-bg); color: var(--danger-fg); border: 1px solid #E3C3BB; }

.hd-field { margin-bottom: 14px; }
.hd-field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.hd-field input, .hd-field select, .hd-field textarea { width: 100%; border: 1px solid var(--line);
  background: var(--card); border-radius: 9px; padding: 9px 12px; font-size: 14px; }
.hd-form { max-width: 420px; }
.hd-form--centered { margin: 0 auto; }

/* Datei-Auswahl: der native Button ist je nach Browser winzig und grau und
   geht neben den gestylten Feldern unter. Der Input bekommt denselben Rahmen
   wie die übrigen Felder, der Auswahl-Button die Optik eines Sekundär-Buttons. */
.hd-fileinput { width: 100%; max-width: 420px; border: 1px solid var(--line);
  background: var(--card); border-radius: 9px; padding: 8px 10px; font-size: 14px;
  color: var(--muted); cursor: pointer; }
.hd-fileinput::file-selector-button { border: 1px solid var(--line); background: var(--chip);
  color: var(--ink); font-size: 13px; font-weight: 600; padding: 7px 14px;
  border-radius: 8px; margin-right: 12px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s; }
.hd-fileinput::file-selector-button:hover { border-color: var(--accent); }

/* Zweiter Weg auf der Import-Seite (Tabelle statt Einzelobjekt): sichtbar
   abgesetzt, damit nicht wie ein Anhängsel des Formulars darüber wirkt. */
.hd-import-alt { max-width: 860px; margin-top: 26px; padding: 18px 20px; }
.hd-import-alt h2 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.hd-errors { background: var(--danger-bg); color: var(--danger-fg); border-radius: 9px;
  padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }

.hd-project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.hd-project-card__cover { height: 110px; }
.hd-project-card__body { padding: 16px 20px 20px; }
.hd-project-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hd-project-card__name { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.hd-project-card__members { display: flex; }
.hd-avatar--small { width: 26px; height: 26px; font-size: 10px; border: 2px solid #FFFFFF; margin-left: -6px; }
.hd-project-card__desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hd-project-card__stats { display: flex; gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--divider); }
.hd-project-card__stats b { display: block; font-size: 18px; font-weight: 600; }
.hd-project-card__stats span { font-size: 11px; color: var(--faint); }
.hd-project-card--new { display: flex; align-items: center; justify-content: center; min-height: 220px;
  border-style: dashed; color: var(--faint); font-weight: 600; }
.hd-project-card--new:hover { color: var(--accent); }

.hd-form-wide { max-width: 860px; }
.hd-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.hd-field--full { grid-column: 1 / -1; }
.hd-backlink { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 14px; }
.hd-backlink:hover { color: var(--accent); }
.hd-dossier-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hd-dossier-head__price { text-align: right; }
.hd-price { font-family: var(--serif); font-size: 28px; font-weight: 600; }
.hd-score-ring { width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-family: var(--serif);
  font-size: 20px; font-weight: 600; margin: 10px 0 4px auto; }
.hd-score-ring--small { width: 44px; height: 44px; border-width: 3px; font-size: 14px; margin: 0; }
/* Zwei Gruppen im Kopf: links die maschinelle Bewertung (Ring, Confidence,
   Analyse neu starten), rechts die eigene Einstufung und die Verweise. */
.hd-actions-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-top: 10px; }
/* Der Container ist rechtsbuendig -- die linke Spalte muss das zuruecknehmen. */
.hd-actions-row__score { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
/* Ohne das auto-Margin der Grundregel, sonst rutschte der Ring nach rechts. */
.hd-actions-row__score .hd-score-ring { margin: 0 0 4px 0; }
.hd-actions-row__links { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.hd-actions-row__links .hd-rank-btns { margin-top: 0; }
.hd-edit-links { display: flex; gap: 8px; }
@media (max-width: 640px) {
  .hd-actions-row { flex-direction: column; align-items: flex-start; gap: 14px; }
  .hd-actions-row__links { align-items: flex-start; }
}
.hd-badge { display: inline-flex; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--chip); color: #586550; }
.hd-badge--interessant { background: #DEEBD8; color: var(--accent); }
.hd-badge--zu-pruefen { background: var(--warn-bg); color: #8A6524; }
.hd-badge--kontakt-aufgenommen, .hd-badge--besichtigung-geplant, .hd-badge--besichtigt { background: #E2EAF0; color: #35566E; }
.hd-badge--angebot-abgegeben { background: #35566E; color: #F7FAF3; }
.hd-badge--verworfen { background: #F0E6E2; color: #8E4A38; }
.hd-badge--archiviert { background: var(--chip); color: var(--faint); }

.hd-list-toolbar { display: flex; align-items: center; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.hd-list-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; }
.hd-chip span { opacity: 0.55; margin-left: 5px; }
.hd-chip--active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.hd-sort-form select { border: 1px solid var(--line); background: var(--card); border-radius: 9px; padding: 8px 10px; font-size: 13px; }
.hd-listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 20px; }
.hd-listing-card__cover { height: 150px; display: flex; align-items: flex-start; padding: 10px; background-size: cover; background-position: center; }
.hd-listing-card__body { padding: 16px; }
.hd-listing-card__title { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.hd-listing-card__meta { font-size: 13px; color: var(--muted); margin-top: 1px; }
.hd-listing-card__stats { display: flex; gap: 14px; margin-top: 12px; font-size: 13px; }
.hd-listing-card__stats b { display: block; font-weight: 600; }
.hd-listing-card__stats span { font-size: 11px; color: var(--faint); }
.hd-empty { text-align: center; padding: 60px 20px; color: var(--faint); font-size: 14px; }

/* Projekt-Kartenansicht: z-index 0 kapselt die Leaflet-Panes (z 200–700),
   damit sie nicht über die sticky Navigation ragen. */
.hd-project-map { height: min(65vh, 620px); margin-top: 16px; border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; position: relative; z-index: 0; }
.hd-map-photo-pin__wrap { background: none; border: none; }
.hd-map-photo-pin { position: relative; width: 52px; height: 52px; border-radius: 50%;
  background-size: cover; background-position: center; border: 3px solid var(--card);
  box-shadow: 0 2px 10px rgba(34, 48, 31, 0.35); }
.hd-map-photo-pin::after { content: ""; position: absolute; left: 50%; bottom: -13px;
  transform: translateX(-50%); border: 7px solid transparent; border-top-color: var(--card); }
.hd-map-rank-pin { position: relative; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #F7FAF3; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--card); box-shadow: 0 2px 10px rgba(34, 48, 31, 0.35); }
.hd-map-rank-pin::after { content: ""; position: absolute; left: 50%; bottom: -13px;
  transform: translateX(-50%); border: 7px solid transparent; border-top-color: var(--card); }
.hd-map-pin-rank { position: absolute; top: -5px; right: -5px; min-width: 22px; height: 22px;
  padding: 0 5px; border-radius: 11px; background: var(--accent); color: #F7FAF3;
  font-size: 12px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; border: 2px solid var(--card); }
.hd-map-popup__rank { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.hd-map-popup { font-family: var(--sans); }
.hd-map-popup img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px;
  margin-bottom: 8px; display: block; }
.hd-map-popup__title { display: block; font-weight: 600; color: var(--ink); text-decoration: none; }
.hd-map-popup__title:hover { color: var(--accent); }
.hd-map-popup__meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hd-map-popup__price { font-weight: 600; margin-top: 4px; }
.hd-view-toggle { display: flex; background: var(--chip); border-radius: 9px; padding: 3px; gap: 2px; }
.hd-view-toggle__btn { padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.hd-view-toggle__btn--active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(35,43,39,0.12); }
.hd-listing-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.hd-listing-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px 12px 12px; border-radius: 12px; flex-wrap: wrap; }
.hd-listing-row__thumb { width: 72px; height: 56px; border-radius: 8px; flex-shrink: 0; background-size: cover; background-position: center; }
.hd-listing-row__main { flex: 1; min-width: 180px; }
.hd-listing-row__title { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.hd-listing-row__stats { display: flex; gap: 20px; align-items: center; font-size: 13px; text-align: right; }
.hd-listing-row__sub { font-size: 11px; color: var(--faint); }
.hd-listing-grid--wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.hd-dossier-card { padding: 18px; }
.hd-dossier-card__facts { display: flex; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

.hd-tabs { display: flex; gap: 2px; margin-top: 26px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.hd-tabs__tab { padding: 9px 13px; font-size: 13.5px; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.hd-tabs__tab:hover { color: var(--accent); }
.hd-tabs__tab--active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.hd-tab-content { margin-top: 24px; }
.hd-tab-badge { margin-left: 5px; font-size: 10.5px; font-weight: 600; background: #F5E4E0; color: #8E3423; padding: 1px 6px; border-radius: 99px; }
.hd-fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.hd-fact { padding: 14px 16px; }
.hd-fact b { display: block; font-size: 16px; font-weight: 600; }
.hd-fact span { font-size: 11px; color: var(--faint); }
.hd-overview-text { font-family: var(--serif); font-size: 19px; line-height: 1.55; margin: 0; }
.hd-kv { padding: 8px 24px; }
.hd-kv__row { display: flex; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--divider); font-size: 13.5px; flex-wrap: wrap; }
.hd-kv__row:last-child { border-bottom: none; }
.hd-kv__key { width: 190px; color: var(--faint); flex-shrink: 0; }
.hd-kv__val { flex: 1; min-width: 200px; }
.hd-original-text { font-size: 13.5px; color: #4B5842; line-height: 1.65; font-style: italic; margin: 0; }
.hd-notice { border-radius: 12px; padding: 14px 18px; font-size: 13.5px; margin-bottom: 14px; }
.hd-notice--warn { background: var(--warn-bg); border: 1px solid #E3D3AC; color: var(--warn-fg); }
.hd-maplink { color: var(--accent); font-weight: 500; font-size: 13.5px; text-decoration: none; }
.hd-maplink:hover { text-decoration: underline; }
.hd-status-form { display: inline-block; }
.hd-status-select { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 600; background: var(--card); cursor: pointer; }

.hd-comments { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.hd-comment { padding: 14px 18px; }
.hd-comment__head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; flex-wrap: wrap; }
.hd-comment__time { margin-left: auto; font-size: 12px; color: var(--faint); }
.hd-comment__body { font-size: 14px; margin: 10px 0 0; line-height: 1.55; }
.hd-comment-cat--pro { background: #DEEBD8; color: var(--accent); }
.hd-comment-cat--contra { background: var(--danger-bg); color: var(--danger-fg); }
.hd-comment-cat--frage { background: var(--warn-bg); color: #8A6524; }
.hd-comment-cat--maklerfrage, .hd-comment-cat--besichtigungsnotiz { background: #E2EAF0; color: #35566E; }
.hd-comment-cat--allgemein { background: var(--chip); color: #586550; }
.hd-comment-form__head { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.hd-comment-form__head select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; background: var(--card); }
.hd-comments + .hd-card textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 14px; background: #F7FAF3; resize: vertical; }

.hd-gallery { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 12px; }
.hd-gallery__item { flex: 0 0 auto; display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.hd-gallery__item img { display: block; max-height: 90px; width: auto; height: 90px; object-fit: cover; }

.hd-files { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.hd-file { display: flex; align-items: center; gap: 14px; padding: 12px 18px; flex-wrap: wrap; }
.hd-file__icon { width: 38px; height: 38px; border-radius: 9px; background: var(--chip); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.hd-file__meta { flex: 1; min-width: 200px; font-size: 14px; }
.hd-file__meta a { color: var(--ink); font-weight: 500; }

.hd-history { max-width: 640px; }
.hd-history__item { display: flex; gap: 14px; padding-bottom: 22px; position: relative; }
.hd-history__item::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: 0; width: 1px; background: var(--line); }
.hd-history__item:last-child::before { display: none; }
.hd-history__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; z-index: 1; }
.hd-history__text { font-size: 14px; font-weight: 500; }
.hd-news__item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.hd-news__item:last-child { border-bottom: none; }

.hd-import-input { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; font-size: 14.5px; background: var(--card); line-height: 1.6; resize: vertical; }
.hd-import-detected { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; background: #DEEBD8; color: var(--accent); font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 99px; }
.hd-code { background: #F7FAF3; border: 1px solid var(--divider); border-radius: 9px; padding: 12px; font-size: 12px; overflow-x: auto; margin-top: 10px; }
.hd-import-status { display: flex; gap: 16px; align-items: center; padding: 20px 24px; }
.hd-spinner { width: 22px; height: 22px; border: 3px solid var(--chip); border-top-color: var(--accent); border-radius: 50%; animation: hd-spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes hd-spin { to { transform: rotate(360deg); } }
.hd-notice--danger { background: var(--danger-bg); border: 1px solid #E3C3BB; color: var(--danger-fg); }
.hd-int--success { background: #DEEBD8; color: var(--accent); }
.hd-int--failed { background: var(--danger-bg); color: var(--danger-fg); }
.hd-int--pending { background: var(--warn-bg); color: var(--warn-fg); }
.hd-int--not_possible { background: var(--chip); color: var(--faint); }

.hd-risks { display: flex; flex-direction: column; gap: 12px; max-width: 780px; }
.hd-risk { padding: 16px 20px; border-left: 4px solid var(--faint); }
.hd-risk--inactive { opacity: 0.55; }
.hd-risk__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hd-risk__severity { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.hd-risk__title { font-weight: 600; margin-top: 8px; }
.hd-risk__desc { font-size: 14px; margin-top: 4px; }
.hd-status-btns { display: flex; gap: 6px; margin-left: auto; }
.hd-status-btns form { display: inline-block; }
.hd-status-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.hd-status-btn--active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.hd-question { padding: 16px 20px; }
.hd-question__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hd-question__text { font-weight: 500; }
.hd-answer-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.hd-answer-form input[type="text"] { flex: 1; min-width: 220px; border: 1px solid var(--line);
  background: var(--card); border-radius: 8px; padding: 7px 10px; font-size: 13.5px; }
.hd-answer-note { font-size: 13.5px; color: var(--muted); margin-top: 8px; }

.hd-footer { text-align: center; color: var(--faint); font-size: 12.5px; padding: 28px 20px 20px; }
.hd-footer a { color: var(--muted); }

.hd-avatar--add { background: transparent; border: 1.5px dashed var(--faint); color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1; }
.hd-avatar--add:hover { border-color: var(--accent, #2E6141); color: var(--ink); }
.hd-inline-edit { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 14px; padding: 0 4px; }
.hd-inline-edit:hover { color: var(--ink); }

.hd-dossier-card__cover { height: 120px; border-radius: 12px; margin-bottom: 12px; }

.pf-icon svg { width: 1em; height: 1em; vertical-align: -0.12em; }
.hd-comment-count { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.hd-rank-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.hd-rank-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.hd-rank-item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
.hd-rank-item--top { border-color: #C9A84C; box-shadow: 0 1px 6px rgba(185, 151, 73, 0.18); }
.hd-rank-item--dragging { opacity: 0.45; }
.hd-rank-item--unranked { border-style: dashed; }
.hd-rank-item--discarded { opacity: 0.45; border-style: dashed; }
.hd-rank-item--discarded:hover { opacity: 0.75; }
.hd-rank-item--focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.hd-rank-divider { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 18px 0 10px; padding-top: 12px; border-top: 2px dashed var(--line); }
/* Die Zone muss auch leer sichtbar und hoch genug zum Hineinziehen sein --
   eine leere Flex-Liste waere 0px hoch und damit kein Ziel. */
.hd-rank-dropzone { min-height: 64px; border: 2px dashed var(--line); border-radius: 12px; padding: 10px; background: rgba(0, 0, 0, 0.015); }
.hd-rank-dropzone__hint { margin: 0; padding: 8px 4px; color: var(--faint); font-size: 13px; text-align: center; }
.hd-rank-divider__label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.hd-rank-more { display: block; width: 100%; margin: 8px 0; padding: 7px; border: 1px dashed var(--line); background: none; border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 13px; }
.hd-rank-more:hover { border-color: var(--accent); color: var(--accent); }
.hd-rank-overlay { border: none; border-radius: 14px; padding: 0; max-width: 900px; width: 92vw; background: var(--bg); color: var(--ink); }
.hd-rank-overlay::backdrop { background: rgba(20, 20, 18, 0.55); }
.hd-rank-overlay__head { display: flex; flex-direction: column; gap: 2px; padding: 18px 22px 10px; }
.hd-rank-overlay__head h2 { margin: 0; font-family: var(--serif); }
.hd-rank-overlay__body { padding: 0 22px 22px; max-height: 70vh; overflow-y: auto; }
.hd-rank-overlay__close { position: absolute; top: 14px; right: 16px; border: none; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.hd-rank-btns { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.hd-rank-btns form { margin: 0; }
/* Einheitliche Hoehe fuer alles in der rechten Spalte: Like, Dislike und die
   beiden Verweise stehen direkt uebereinander, drei verschiedene Hoehen
   (36,5 / 36 / 41px) wirken dort ausgefranst. */
.hd-rank-btn, .hd-edit-links .hd-btn { height: 36px; padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; }
.hd-rank-btn { white-space: nowrap; gap: 7px; }
.hd-rank-btn .pf-icon { display: inline-flex; }
.hd-rank-btn .pf-icon svg { width: 16px; height: 16px; vertical-align: 0; }
/* Nur-Icon-Knopf: quadratisch statt breit, sonst steht ein Daumen einsam in
   einem Knopf mit Platz fuer Text. */
.hd-rank-btn--dislike { padding-left: 11px; padding-right: 11px; }
.hd-rank-item__main { flex: 1; min-width: 0; }
.hd-rank-item__voters { display: flex; gap: 6px; flex-shrink: 0; }
.hd-rank-item__voters .hd-avatar b { font-size: 9px; margin-left: 1px; }
.hd-rank-pos { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; background: var(--divider); color: var(--muted); flex-shrink: 0; }
.hd-rank-pos--1 { background: #E5C558; color: #4C3A08; }
.hd-rank-pos--2 { background: #D4D4D0; color: #45453F; }
.hd-rank-pos--3 { background: #D9A05B; color: #4E2E10; }
.hd-rank-grip { cursor: grab; color: var(--faint); font-weight: 700; }

.hd-nav__brand { display: inline-flex; align-items: center; gap: 9px; }
.hd-nav__brand svg { width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; }
.hd-nav__brand-text span { color: var(--accent); }
.hd-nav__avatar { text-decoration: none; }
/* Auf Avatar-Hoehe: der Button waere sonst 41px hoch (9px Polsterung oben und
   unten plus Zeilenhoehe und Rahmen) und ragte neben dem 34px-Kreis oben wie
   unten heraus -- beide sind zentriert, wirken so aber schief. */
.hd-nav__new { white-space: nowrap; height: 34px; padding: 0 14px; display: inline-flex; align-items: center; }
@media (max-width: 600px) {
  .hd-nav__brand-text { display: none; }
  .hd-nav__new span { display: none; }
  .hd-nav { gap: 12px; }
}

.hd-rank-item__main a { color: var(--ink); text-decoration: none; font-family: var(--serif); }
.hd-rank-item__main a:hover { text-decoration: underline; }
.hd-news__item a { color: var(--accent); text-decoration: none; }
.hd-news__item a:hover { text-decoration: underline; }

.hd-rank-switch { display: flex; align-items: center; gap: 7px; flex: 1; flex-wrap: wrap; }
.hd-rank-switch__label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-right: 6px; }
a.hd-rank-switch__avatar { opacity: 0.65; text-decoration: none; transition: opacity 0.15s; }
a.hd-rank-switch__avatar:hover { opacity: 1; }
a.hd-rank-switch__avatar--active { opacity: 1; background: var(--accent); color: #fff; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

.hd-news__thumb { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }

.hd-pagination { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 22px 0 6px; }

/* Auth-Seiten (Login/Registrierung) */
.hd-auth { display: flex; justify-content: center; padding: clamp(24px, 6vh, 64px) 16px; }
.hd-auth__card { width: 100%; max-width: 440px; background: #FFFEFB; border: 1px solid var(--line); border-radius: 18px; padding: clamp(24px, 4vw, 38px); box-shadow: 0 8px 30px rgba(40, 50, 30, 0.06); }
.hd-auth__card h1 { margin: 0 0 4px; }
.hd-auth__card > .hd-sub { margin: 0 0 20px; }
.hd-btn--block { display: block; width: 100%; text-align: center; padding: 11px 20px; margin-top: 4px; }
.hd-consent { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; font-size: 13px; color: var(--muted); line-height: 1.45; cursor: pointer; }
.hd-consent input[type="checkbox"] { width: 17px; height: 17px; margin-top: 1px; flex-shrink: 0; accent-color: var(--accent); }
.hd-consent a { color: var(--accent); }
.hd-auth__divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--faint); font-size: 12px; }
.hd-auth__divider::before, .hd-auth__divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hd-auth__foot { margin-top: 18px; text-align: center; }
.hd-auth__foot a { color: var(--accent); }

.hd-rank-move { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.hd-rank-move__btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 22px; border: 1px solid var(--line); background: var(--card); border-radius: 6px; cursor: pointer; color: var(--muted); padding: 0; }
.hd-rank-move__btn:hover { border-color: var(--accent); color: var(--accent); }
.hd-rank-move__btn svg { width: 15px; height: 15px; }
@media (hover: none) { .hd-rank-grip { display: none; } }

/* Objektlisten-Toolbar mobil: Filter-Chips, Sortierung und Ansichts-Umschalter
   untereinander statt nebeneinander (verhindert horizontales Scrollen). */
@media (max-width: 600px) {
  .hd-list-toolbar { flex-direction: column; align-items: stretch; }
  .hd-list-toolbar .hd-view-toggle { align-self: flex-start; }
  .hd-list-toolbar .hd-btn { align-self: flex-start; }
}

/* Rangliste-Toolbar mobil: erst Ansichts-Umschalter + Button, dann der
   Personen-Umschalter darunter über die volle Breite (statt nebeneinander). */
@media (max-width: 600px) {
  .hd-list-toolbar--rank { flex-direction: column; align-items: stretch; }
  .hd-list-toolbar--rank .hd-view-toggle { order: 1; align-self: flex-start; }
  .hd-list-toolbar--rank .hd-btn { order: 2; }
  .hd-list-toolbar--rank .hd-rank-switch { order: 3; width: 100%; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
}

/* Verlinkte Kommentar-Threads an Risiken/Fragen/Fotos */
.hd-thread { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.hd-thread__item { display: flex; gap: 8px; margin-bottom: 8px; }
.hd-thread__meta { font-size: 12px; color: var(--muted); }
.hd-thread__body { font-size: 13.5px; }
.hd-thread__body p { margin: 2px 0; }
.hd-thread__form { display: flex; gap: 8px; margin-top: 6px; }
.hd-thread__form input[type="text"] { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; background: var(--card); }
.hd-badge--subject { background: var(--chip); color: var(--accent); text-decoration: none; }
.hd-badge--subject:hover { text-decoration: underline; }

/* Foto-Lightbox */
.hd-gallery__item { position: relative; }
.hd-gallery__badge { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; background: rgba(25, 30, 24, 0.72); color: #fff; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; }
.hd-lightbox[hidden] { display: none; }
.hd-lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(20, 24, 19, 0.92); display: flex; align-items: center; justify-content: center; padding: 20px; }
.hd-lightbox__stage { max-width: min(1100px, 92vw); max-height: 92vh; display: flex; flex-direction: column; gap: 10px; }
.hd-lightbox__stage img { max-width: 100%; max-height: 62vh; object-fit: contain; border-radius: 10px; }
.hd-lightbox__meta { color: #cfd6c9; font-size: 13px; }
.hd-lightbox__thread { background: var(--bg); border-radius: 12px; padding: 12px 14px; max-height: 24vh; overflow-y: auto; }
.hd-lightbox__thread .hd-thread { border-top: none; padding-top: 0; margin-top: 0; }
.hd-lightbox__close { position: absolute; top: 14px; right: 18px; font-size: 30px; background: none; border: none; color: #fff; cursor: pointer; line-height: 1; }
.hd-lightbox__nav { background: none; border: none; color: #fff; font-size: 44px; cursor: pointer; padding: 0 14px; line-height: 1; }
@media (max-width: 600px) { .hd-lightbox__nav { font-size: 32px; padding: 0 6px; } }

/* Dateien-Tab: Bild-Thumbnails statt Datei-Icon */
.hd-file__thumb { flex-shrink: 0; }
.hd-file__thumb img { width: 84px; height: 60px; object-fit: cover; border-radius: 8px; display: block; }
.hd-file__icon .pf-icon svg { width: 26px; height: 26px; color: var(--muted); }

/* Hinweis "N Objekte warten aufs Einsortieren" über der Objektliste */
.hd-rank-nudge { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 7px 14px; background: var(--chip); border: 1px dashed var(--accent); border-radius: 999px; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.hd-rank-nudge:hover { background: var(--card); }

/* Hervorhebung fuer Hochrisiko-Datenbausteine (z. B. Waldbrand) */
.hd-card--risk-high { border-left: 4px solid var(--danger-fg); }
