/* ReefDashboard – Ozean Dark Theme */
:root {
  --reef-bg:        #0a1628;
  --reef-card:      #0d2137;
  --reef-card-2:    #112840;
  --reef-border:    #1a3a55;
  --reef-cyan:      #00b4d8;
  --reef-cyan-dark: #0096b7;
  --reef-orange:    #ff6b35;
  --reef-green:     #2ecc71;
  --reef-yellow:    #f39c12;
  --reef-red:       #e74c3c;
  --reef-gray:      #4a6275;
  --reef-text:      #cdd8e3;
  --reef-text-muted:#6b8fa8;
  --sidebar-width:  240px;
  --bottom-nav-h:   60px;
}

/* ── Base ── */
body {
  background-color: var(--reef-bg);
  color: var(--reef-text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
}

/* ── Sidebar ── */
.reef-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--reef-card);
  border-right: 1px solid var(--reef-border);
  z-index: 1000;
  overflow-y: auto;
  padding-bottom: 1rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.2rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--reef-cyan);
  border-bottom: 1px solid var(--reef-border);
  margin-bottom: 1rem;
}
.sidebar-brand i { font-size: 1.4rem; }

.sidebar-nav { display: flex; flex-direction: column; gap: .15rem; padding: 0 .5rem; }
.sidebar-nav .nav-link,
.sidebar-footer .nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .8rem;
  border-radius: 8px;
  color: var(--reef-text-muted);
  transition: background .15s, color .15s;
  font-size: .9rem;
}
.sidebar-nav .nav-link:hover,
.sidebar-footer .nav-link:hover { background: var(--reef-border); color: var(--reef-text); }
.sidebar-nav .nav-link.active  { background: rgba(0,180,216,.15); color: var(--reef-cyan); font-weight: 600; }
.sidebar-nav .nav-link i { font-size: 1.05rem; width: 1.2rem; }

.sidebar-footer { padding: .5rem .5rem 0; border-top: 1px solid var(--reef-border); margin-top: auto; padding-top: .8rem; }

/* ── Main Content ── */
.reef-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--reef-bg);
  display: flex;
  flex-direction: column;
}
.reef-main > .container-fluid {
  max-width: 1600px;
  flex: 1;          /* nimmt allen verfügbaren Platz – Footer bleibt unten */
}
@media (max-width: 991.98px) {
  .reef-main { margin-left: 0; }
  .reef-main > .container-fluid { padding-bottom: calc(var(--bottom-nav-h) + 1rem); }
}

/* ── Bottom Nav Mobile ── */
.reef-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--reef-card);
  border-top: 1px solid var(--reef-border);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: .1rem; font-size: .65rem; color: var(--reef-text-muted);
  text-decoration: none; flex: 1; padding: .4rem 0;
  transition: color .15s; cursor: pointer; position: relative;
}
.bottom-nav-item i { font-size: 1.2rem; }
.bottom-nav-item.active { color: var(--reef-cyan); }
.bottom-nav-item:hover  { color: var(--reef-text); }

.mobile-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 20px);
  background: var(--reef-red);
  color: #fff;
  font-size: .55rem;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* ── Cards ── */
.reef-card {
  background: var(--reef-card);
  border: 1px solid var(--reef-border);
  border-radius: 12px;
  padding: 1.2rem;
}
.reef-card-dark {
  background: var(--reef-card-2);
  border: 1px solid var(--reef-border);
  border-radius: 12px;
  padding: 1.2rem;
}
.reef-card .card-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--reef-text-muted);
  margin-bottom: .3rem;
}
.reef-card .card-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--reef-cyan);
  line-height: 1;
}
.reef-card .card-sub { font-size: .8rem; color: var(--reef-text-muted); margin-top: .2rem; }

/* ── Ampel-Badges ── */
.badge-ok       { background: rgba(46,204,113,.18); color: var(--reef-green); border: 1px solid rgba(46,204,113,.3); }
.badge-warning  { background: rgba(243,156,18,.18);  color: var(--reef-yellow); border: 1px solid rgba(243,156,18,.3); }
.badge-critical { background: rgba(231,76,60,.18);   color: var(--reef-red);    border: 1px solid rgba(231,76,60,.3); }
.badge-neutral  { background: rgba(74,98,117,.18);   color: var(--reef-gray);   border: 1px solid rgba(74,98,117,.3); }

/* Ampel-Punkte */
.status-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
}
.status-dot.ok       { background: var(--reef-green); box-shadow: 0 0 6px var(--reef-green); }
.status-dot.warning  { background: var(--reef-yellow); box-shadow: 0 0 6px var(--reef-yellow); }
.status-dot.critical { background: var(--reef-red);   box-shadow: 0 0 6px var(--reef-red); }
.status-dot.neutral  { background: var(--reef-gray); }

/* ── Parameter-Grid ── */
.param-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; }
.param-item {
  background: var(--reef-card-2);
  border: 1px solid var(--reef-border);
  border-radius: 8px;
  padding: .7rem;
  text-align: center;
  transition: border-color .2s;
}
.param-item.ok       { border-color: rgba(46,204,113,.4); }
.param-item.warning  { border-color: rgba(243,156,18,.4); }
.param-item.critical { border-color: rgba(231,76,60,.4); }
.param-item .param-name  { font-size: .7rem; color: var(--reef-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.param-item .param-value { font-size: 1.15rem; font-weight: 700; margin: .2rem 0; }
.param-item .param-unit  { font-size: .7rem; color: var(--reef-text-muted); }

/* ── Forms ── */
.form-control, .form-select {
  background-color: var(--reef-card-2) !important;
  border-color: var(--reef-border) !important;
  color: var(--reef-text) !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--reef-cyan) !important;
  box-shadow: 0 0 0 .2rem rgba(0,180,216,.2) !important;
}
.form-control::placeholder { color: var(--reef-text-muted) !important; }
.form-label { font-size: .85rem; color: var(--reef-text-muted); margin-bottom: .3rem; }
.input-group-text {
  background: var(--reef-border) !important;
  border-color: var(--reef-border) !important;
  color: var(--reef-text-muted) !important;
  font-size: .8rem;
}

/* Echtzeit-Ampel auf Eingabefeldern */
.form-control.field-ok       { border-color: var(--reef-green) !important; }
.form-control.field-warning   { border-color: var(--reef-yellow) !important; }
.form-control.field-critical  { border-color: var(--reef-red) !important; }
.field-hint { font-size: .72rem; margin-top: .15rem; }
.field-hint.ok       { color: var(--reef-green); }
.field-hint.warning  { color: var(--reef-yellow); }
.field-hint.critical { color: var(--reef-red); }

/* ── Buttons ── */
.btn-cyan {
  background: var(--reef-cyan);
  border-color: var(--reef-cyan);
  color: #fff;
}
.btn-cyan:hover { background: var(--reef-cyan-dark); border-color: var(--reef-cyan-dark); color: #fff; }
.btn-outline-cyan {
  border-color: var(--reef-cyan);
  color: var(--reef-cyan);
}
.btn-outline-cyan:hover { background: var(--reef-cyan); color: #fff; }

/* ── Section Headers ── */
.reef-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--reef-cyan);
  margin-bottom: 1rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--reef-border);
}

/* ── Tables ── */
.table { color: var(--reef-text); }
.table thead th { color: var(--reef-text-muted); font-size: .8rem; text-transform: uppercase; border-color: var(--reef-border); }
.table td, .table th { border-color: var(--reef-border); }
.table tbody tr:hover td { background: rgba(255,255,255,.03); }

/* ── Alerts / Toasts ── */
.reef-alert {
  border-radius: 8px;
  padding: .8rem 1rem;
  margin-bottom: .5rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .87rem;
}
.reef-alert.info     { background: rgba(0,180,216,.12); border-left: 3px solid var(--reef-cyan); }
.reef-alert.warning  { background: rgba(243,156,18,.12); border-left: 3px solid var(--reef-yellow); }
.reef-alert.critical { background: rgba(231,76,60,.12);  border-left: 3px solid var(--reef-red); }

/* ── Score Ring ── */
.score-ring-wrap { position: relative; display: inline-block; }
.score-ring-value {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem; font-weight: 700;
}

/* ── Charts ── */
.chart-container { position: relative; }

/* ── Login / Register ── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--reef-bg);
}
.auth-card {
  background: var(--reef-card);
  border: 1px solid var(--reef-border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--reef-cyan);
  font-size: 2rem;
}
.auth-logo h1 { font-size: 1.4rem; margin-top: .3rem; }

/* ── Dosierung ── */
.dosing-result {
  background: var(--reef-card-2);
  border: 1px solid var(--reef-border);
  border-radius: 10px;
  padding: 1rem;
  margin-top: .8rem;
}
.dosing-result .dose-param { font-weight: 600; color: var(--reef-cyan); }
.dosing-result .dose-amount { font-size: 1.3rem; font-weight: 700; }
.dosing-result .dose-schedule { font-size: .85rem; color: var(--reef-text-muted); }

/* ── Krankheitskarten ── */
.disease-card {
  background: var(--reef-card);
  border: 1px solid var(--reef-border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .2s;
}
.disease-card:hover { border-color: var(--reef-cyan); }
.disease-card .disease-header {
  background: var(--reef-card-2);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.disease-card .disease-body { padding: 1rem; }
.disease-tag {
  font-size: .7rem;
  padding: .2rem .5rem;
  border-radius: 4px;
  font-weight: 600;
}
.disease-tag.fish     { background: rgba(0,180,216,.2);   color: var(--reef-cyan); }
.disease-tag.coral    { background: rgba(255,107,53,.2);  color: var(--reef-orange); }
.disease-tag.bacteria { background: rgba(155,89,182,.2);  color: #9b59b6; }
.disease-tag.parasite { background: rgba(26,188,156,.2);  color: #1abc9c; }
.disease-tag.algae    { background: rgba(39,174,96,.2);   color: #27ae60; }

/* ── ICP ── */
.icp-element {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .6rem;
  border-radius: 6px;
  font-size: .85rem;
}
.icp-element:nth-child(odd) { background: rgba(255,255,255,.03); }
.icp-bar { height: 4px; border-radius: 2px; background: var(--reef-border); flex: 1; margin: 0 .6rem; position: relative; overflow: hidden; }
.icp-bar-fill { height: 100%; border-radius: 2px; transition: width .3s; }

/* ── KI-Assistent ── */
.chat-window {
  height: 420px;
  overflow-y: auto;
  background: var(--reef-card-2);
  border: 1px solid var(--reef-border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.chat-bubble {
  max-width: 80%;
  padding: .7rem 1rem;
  border-radius: 12px;
  font-size: .88rem;
  line-height: 1.5;
}
.chat-bubble.user  { background: rgba(0,180,216,.2); align-self: flex-end; }
.chat-bubble.bot   { background: var(--reef-card); border: 1px solid var(--reef-border); align-self: flex-start; }

/* ── Sidebar Community-Erweiterungen ── */
.sidebar-section-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--reef-text-muted);
  padding: .4rem .8rem .1rem;
  margin-top: .3rem;
}
.sidebar-profile-card {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .8rem;
  border-radius: 8px;
  background: var(--reef-card-2);
  border: 1px solid var(--reef-border);
  margin: 0 .5rem .4rem;
  transition: border-color .15s;
}
.sidebar-profile-card:hover { border-color: var(--reef-cyan); }
.sidebar-profile-info { min-width: 0; overflow: hidden; }

/* ── Rang-Badge ── */
.rank-badge {
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Abzeichen-Grid ── */
.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
  text-align: center;
  cursor: default;
}

/* ── Forum: Index ── */
.forum-cat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.forum-subcat-row {
  display: block;
  padding: .7rem 0;
  transition: background .15s;
}
.forum-subcat-row:hover { background: rgba(255,255,255,.02); }
.forum-subcat-row .d-flex { gap: .8rem; align-items: center; }

/* ── Forum: Kategorie-Threads ── */
.forum-thread-row {
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--reef-border);
  transition: background .15s;
  text-decoration: none !important;
  color: inherit !important;
}
.forum-thread-row:last-child { border-bottom: none; }
.forum-thread-row:hover { background: rgba(0,180,216,.05); }

.ft-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  flex-shrink: 0;
  text-align: center;
}
.ft-body { flex: 1; min-width: 0; }
.ft-title {
  font-size: .92rem;
  font-weight: 600;
  color: var(--reef-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: .18rem;
}
.ft-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  font-size: .72rem;
  color: var(--reef-text-muted);
}
.ft-pill {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  background: rgba(255,255,255,.05);
  border-radius: 20px;
  padding: 0 7px;
  line-height: 1.7;
}
.ft-last {
  flex-shrink: 0;
  text-align: right;
  width: 155px;
  font-size: .74rem;
  color: var(--reef-text-muted);
  line-height: 1.45;
}
.ft-last .ft-last-user {
  color: var(--reef-text);
  font-weight: 600;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ft-actions {
  flex-shrink: 0;
  display: flex;
  gap: .25rem;
  opacity: 0;
  transition: opacity .15s;
}
.forum-thread-row:hover .ft-actions { opacity: 1; }

@media (max-width: 767.98px) {
  .forum-thread-row { padding: .75rem .8rem; }
  .ft-last { display: none !important; }
  .ft-actions { opacity: 1; }
}

/* ── Forum: Thread / Posts ── */
.forum-post {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
  margin-bottom: 1rem;
  background: var(--reef-card);
  border: 1px solid var(--reef-border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .2s;
}
.forum-post:target { border-color: var(--reef-cyan); }
.forum-post-author {
  background: rgba(0,0,0,.12);
  border-right: 1px solid var(--reef-border);
  padding: 1.1rem .9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .1rem;
}
.forum-post-body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.forum-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--reef-border);
  margin-bottom: .5rem;
}
.forum-post-content {
  font-size: .9rem;
  line-height: 1.65;
  color: var(--reef-text);
  word-break: break-word;
}
.forum-post-content img {
  max-width: 100%;
  border-radius: 8px;
  margin-top: .5rem;
  border: 1px solid var(--reef-border);
}
.post-footer-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-top: .6rem;
  margin-top: .4rem;
  border-top: 1px solid var(--reef-border);
}
#reply-form {
  margin-bottom: 0 !important;
}
@media (max-width: 991.98px) {
  #reply-form { bottom: var(--bottom-nav-h) !important; }
}
@media (max-width: 575.98px) {
  .forum-post { grid-template-columns: 1fr; }
  .forum-post-author {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--reef-border);
    padding: .6rem 1rem;
    justify-content: flex-start;
    text-align: left;
    gap: .8rem;
  }
}

/* Zitat-Block */
.forum-quote {
  background: rgba(0,180,216,.07);
  border-left: 3px solid var(--reef-cyan);
  border-radius: 0 6px 6px 0;
  padding: .6rem .9rem;
  font-size: .84rem;
  color: var(--reef-text-muted);
  margin: .3rem 0 .6rem;
}
.forum-quote cite {
  display: block;
  font-style: normal;
  font-weight: 600;
  color: var(--reef-cyan);
  font-size: .75rem;
  margin-bottom: .3rem;
}

/* Icons in Posts */
.btn-icon {
  background: none;
  border: none;
  padding: 0 .3rem;
  cursor: pointer;
  font-size: .85rem;
  transition: color .15s;
}
.btn-icon:hover { color: var(--reef-cyan) !important; }
.post-link-btn { font-size: .8rem; text-decoration: none; font-weight: 600; }
.mention { color: var(--reef-cyan); font-weight: 600; text-decoration: none; }
.mention:hover { text-decoration: underline; }

/* ── Forum: Neues Thema ── */
.upload-dropzone {
  border: 2px dashed var(--reef-border);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-dropzone:hover,
.upload-dropzone.drag-over {
  border-color: var(--reef-cyan);
  background: rgba(0,180,216,.05);
}

/* ── Pagination ── */
.reef-page-link {
  background: var(--reef-card-2) !important;
  border-color: var(--reef-border) !important;
  color: var(--reef-text) !important;
}
.reef-page-link:hover { background: var(--reef-border) !important; }
.page-item.active .reef-page-link {
  background: var(--reef-cyan) !important;
  border-color: var(--reef-cyan) !important;
  color: #fff !important;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--reef-border); border-radius: 3px; }

/* ── Nav: Unread-Badge ── */
.nav-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--reef-red);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  margin-left: auto;
  line-height: 1;
}

/* ── Private Nachrichten ── */
.pm-conv-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--reef-border);
  cursor: pointer;
  transition: background .15s;
  position: relative;
}
.pm-conv-item:hover  { background: rgba(255,255,255,.03); }
.pm-conv-item.active { background: rgba(0,180,216,.08); border-left: 3px solid var(--reef-cyan); }
.pm-conv-info { flex: 1; min-width: 0; }
.pm-unread-badge {
  background: var(--reef-cyan);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
}
.pm-avatar    { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pm-avatar-sm { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

/* Chat-Nachrichten */
.pm-msg {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  max-width: 75%;
}
.pm-own { align-self: flex-end; flex-direction: row-reverse; }
.pm-bubble {
  background: var(--reef-card-2);
  border: 1px solid var(--reef-border);
  border-radius: 12px;
  padding: .5rem .8rem;
  font-size: .86rem;
  word-break: break-word;
}
.pm-own .pm-bubble { background: rgba(0,180,216,.13); border-color: rgba(0,180,216,.3); }
.pm-sender { font-size: .68rem; font-weight: 700; color: var(--reef-cyan); margin-bottom: .15rem; }
.pm-text   { color: var(--reef-text); line-height: 1.5; }
.pm-time   { font-size: .63rem; color: var(--reef-text-muted); text-align: right; margin-top: .2rem; }

/* Benutzer-Suche im Modal */
.pm-search-result {
  display: flex;
  align-items: center;
  padding: .5rem .8rem;
  cursor: pointer;
  font-size: .85rem;
  border-bottom: 1px solid var(--reef-border);
  transition: background .1s;
}
.pm-search-result:hover { background: var(--reef-border); }
.pm-search-result:last-child { border-bottom: none; }

/* ── Admin ── */
.btn-xs {
  padding: .15rem .4rem;
  font-size: .75rem;
  border-radius: 4px;
}

/* ── Shoutbox ── */
#shoutbox-feed {
  height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .3rem .2rem;
}
.shoutbox-online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--reef-green);
  box-shadow: 0 0 5px var(--reef-green);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}
.shoutbox-msg {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  max-width: 85%;
}
.shoutbox-own {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.shoutbox-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.shoutbox-bubble {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  background: var(--reef-card-2);
  border: 1px solid var(--reef-border);
  border-radius: 10px;
  padding: .35rem .6rem;
  font-size: .82rem;
  position: relative;
  min-width: 60px;
}
.shoutbox-own .shoutbox-bubble {
  background: rgba(0,180,216,.13);
  border-color: rgba(0,180,216,.3);
}
.shoutbox-name {
  font-size: .68rem;
  font-weight: 700;
  color: var(--reef-cyan);
  line-height: 1;
}
.shoutbox-own .shoutbox-name { text-align: right; }
.shoutbox-text {
  color: var(--reef-text);
  word-break: break-word;
  line-height: 1.4;
}
.shoutbox-time {
  font-size: .63rem;
  color: var(--reef-text-muted);
  text-align: right;
  margin-top: .1rem;
}
.shoutbox-del {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: .7rem;
  opacity: 0;
  transition: opacity .15s;
  color: var(--reef-text-muted);
  line-height: 1;
}
.shoutbox-bubble:hover .shoutbox-del { opacity: 1; }
.shoutbox-del:hover { color: var(--reef-red) !important; }

/* ── Forum-Suche ── */
.search-tab-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .8rem;
  border-radius: 20px;
  font-size: .8rem;
  background: var(--reef-card-2);
  border: 1px solid var(--reef-border);
  color: var(--reef-text-muted);
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.search-tab-badge:hover { border-color: var(--reef-cyan); color: var(--reef-text); }
.search-tab-badge.active { border-color: var(--reef-cyan); color: var(--reef-cyan); background: rgba(0,180,216,.1); }
.search-tab-badge span { font-weight: 700; }

.search-result-row {
  display: block;
  padding: .8rem .4rem;
  transition: background .15s;
  border-radius: 4px;
}
.search-result-row:hover { background: rgba(255,255,255,.03); }

mark.search-mark {
  background: rgba(0,180,216,.25);
  color: var(--reef-cyan);
  border-radius: 2px;
  padding: 0 2px;
}

/* ── Utilities ── */
.text-cyan   { color: var(--reef-cyan) !important; }
.text-reef   { color: var(--reef-text) !important; }
.text-muted-reef { color: var(--reef-text-muted) !important; }
.hover-cyan:hover { color: var(--reef-cyan) !important; }
.bg-reef-card { background: var(--reef-card) !important; }
.border-reef  { border-color: var(--reef-border) !important; }
.trend-up   { color: var(--reef-red); }
.trend-down { color: var(--reef-green); }
.trend-neutral { color: var(--reef-text-muted); }

/* ── Footer ── */
.reef-footer {
  background: var(--reef-card);
  border-top: 1px solid var(--reef-border);
  padding: 1.1rem 1.5rem;
  margin-top: 2rem;
}
.reef-footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.5rem;
}
.reef-footer-brand {
  font-weight: 700;
  color: var(--reef-cyan);
  font-size: .9rem;
}
.reef-footer-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.reef-footer-links a {
  color: var(--reef-text-muted);
  text-decoration: none;
  font-size: .82rem;
  transition: color .15s;
}
.reef-footer-links a:hover { color: var(--reef-cyan); }
.reef-footer-copy {
  font-size: .78rem;
  color: var(--reef-text-muted);
  margin-left: auto;
}
@media (max-width: 575.98px) {
  .reef-footer-copy { margin-left: 0; }
  .reef-footer-inner { flex-direction: column; align-items: flex-start; gap: .4rem; }
}
/* Footer auf Mobile über Bottom-Nav schieben */
@media (max-width: 991.98px) {
  .reef-footer { margin-bottom: var(--bottom-nav-h); }
}

/* ── Mobile: Allgemein ── */
@media (max-width: 575.98px) {
  /* Karten kompakter */
  .reef-card, .reef-card-dark { padding: .9rem; }

  /* Profilkopf: Stats untereinander scrollen */
  .reef-card > .d-flex.flex-wrap.gap-4 { gap: 1rem !important; }

  /* Shoutbox Input: Emoji-Button + Input + Send in einer Reihe bleiben */
  #sb-input-wrap { flex-wrap: nowrap; }
  #sb-input { min-width: 0; }

  /* Galerie-Detail-Modal: Bild über Sidebar stapeln */
  #detailModal .row.g-0 { flex-direction: column; }
  #detailModal .col-lg-8 {
    min-height: 45vw;
    border-radius: 0;
  }
  #detailModal .col-lg-4 {
    border-left: none !important;
    border-top: 1px solid var(--reef-border);
  }
  #d-comments { max-height: 150px !important; }


  /* Forum-Thread Post-Header auf Mobile */
  .forum-post-meta { flex-direction: column; align-items: flex-start; gap: .3rem; }

  /* Settings: volle Breite auf Mobile */
  .col-lg-6 { width: 100%; }

  /* Tabellen horizontal scrollbar */
  .table-responsive { -webkit-overflow-scrolling: touch; }
}

/* Touch-freundlichere Buttons (min. 44px Tappfläche) */
@media (max-width: 767.98px) {
  .btn-xs { padding: .3rem .6rem; font-size: .78rem; }
  .bottom-nav-item span { font-size: .6rem; }
}

/* ── Mobile: Modal Vollbild ── */
@media (max-width: 575.98px) {
  .modal-dialog { margin: 0; max-width: 100%; height: 100%; }
  .modal-content { border-radius: 0; height: 100dvh; }
  .modal-xl .row.g-0 { height: 100dvh; overflow-y: auto; }
}

/* ── Mobile: Forum-Kategorie-Seite ── */
@media (max-width: 575.98px) {
  .d-flex.justify-content-between.align-items-center.mb-4.flex-wrap { flex-direction: column; align-items: stretch !important; }
  .d-flex.justify-content-between.align-items-center.mb-4.flex-wrap h2 { margin-bottom: .5rem; }
}

/* ── Mobile: Profil Stats horizontal scrollen statt umbrechen ── */
@media (max-width: 480px) {
  .reef-card > .d-flex.gap-3.flex-wrap.text-center {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .3rem;
  }
  .reef-card > .d-flex.gap-3.flex-wrap.text-center > div { min-width: 70px; }
}
