/* Minimal, icon-first UI for internal messaging shortcode */
.im-messages-app.mini{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Arial,sans-serif;margin:-10px;padding:0}
.im-mini-header{display:flex;align-items:center;gap:10px;margin:10px 10px 15px 10px}
.im-mini-header .im-logo{width:28px;height:28px;border-radius:8px;background:linear-gradient(135deg,#286291,#1e4a6e);display:flex;align-items:center;justify-content:center;color:#fff}
.im-mini-header .im-title{font-weight:700;color:#1f2937;font-size:16px}
.im-tabs{display:flex;gap:8px;margin:0 10px 15px 10px}
.im-tab{position:relative;border:none;background:#f3f4f6;border-radius:12px;padding:12px;min-width:56px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all 0.2s ease}
.im-tab:hover{background:#e5e7eb}
.im-tab.active{background:#1e4a6e;color:#fff}
.im-tab.active:hover{background:#163b5a}
.im-badge{position:absolute;top:-6px;right:-6px;background:#ef4444;color:#fff;border-radius:999px;padding:2px 7px;font-size:11px;font-weight:700}
.im-panel{background:transparent;border:none;border-radius:0;padding:0}
.im-list{list-style:none;margin:0;padding:0}
.im-card{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;border:1px solid #e5e7eb;border-radius:16px;padding:15px;margin:8px 0;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,0.1);touch-action:manipulation;transition:all 0.2s ease}
.im-card:hover{box-shadow:0 4px 12px rgba(0,0,0,0.15);transform:translateY(-1px)}
.im-card.im-reported{border:2px solid #fbbf24;background-color:#fffbeb;box-shadow:0 2px 8px rgba(251,191,36,0.2)}
.im-card.im-reported:hover{box-shadow:0 4px 16px rgba(251,191,36,0.3);transform:translateY(-1px)}
.im-card.im-reported .im-reply-text:disabled{background-color:#f3f4f6;color:#6b7280;cursor:not-allowed}
.im-subject{font-weight:700;color:#111827;font-size:16px;line-height:1.4;text-align:left}
.im-meta{color:#6b7280;font-size:13px;margin-top:2px;text-align:left}
.im-snippet{color:#374151;font-size:14px;grid-column:1/-1;margin-top:6px;line-height:1.4;text-align:left}
.im-replybar{display:flex;align-items:center;gap:8px;grid-column:1/-1;margin-top:10px}
.im-input{flex:1;border:2px solid #e5e7eb;border-radius:12px;padding:12px 14px;font-size:15px;min-height:48px;line-height:1.4;resize:vertical}
.im-input:focus{outline:none;border-color:#1e4a6e;box-shadow:0 0 0 3px rgba(30,74,110,0.1)}
.im-send-btn{width:48px;height:48px;border:none;border-radius:12px;background:#1e4a6e;color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all 0.2s ease}
.im-send-btn:hover{background:#163b5a;transform:scale(1.05)}
.im-send-btn:disabled{background:#9ca3af;transform:none;cursor:not-allowed}
.im-close-btn,.im-thread-btn{width:48px;height:48px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;color:#111827;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all 0.2s ease}
.im-close-btn:hover,.im-thread-btn:hover{background:#f9fafb;border-color:#d1d5db;transform:scale(1.05)}
.im-withdraw-btn{width:48px;height:48px;border:1px solid #f59e0b;border-radius:12px;background:#fef3c7;color:#d97706;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:12px;font-weight:600;transition:all 0.2s ease}
.im-withdraw-btn:hover{background:#fde68a;transform:scale(1.05)}
.im-empty{display:flex;align-items:center;justify-content:center;gap:8px;color:#6b7280;padding:40px 20px;font-size:15px}

/* Modal Styles */
.im-thread-modal{position:fixed;inset:0;background:rgba(17,24,39,.8);display:none;align-items:center;justify-content:center;z-index:2147483646;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);padding:20px;animation:imFadeIn 0.2s ease}
@keyframes imFadeIn{from{opacity:0}to{opacity:1}}
.im-thread-modal[aria-hidden="false"]{display:flex}
.im-thread-dialog{position:relative;z-index:2147483647;width:min(600px,100%);max-height:min(800px, 85vh);background:#fff;border-radius:24px;box-shadow:0 25px 50px -12px rgba(0,0,0,0.5);display:flex;flex-direction:column;overflow:hidden;animation:imSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)}
@keyframes imSlideUp{from{transform:translateY(20px) scale(0.95)}to{transform:translateY(0) scale(1)}}
.im-thread-head{display:flex;align-items:center;justify-content:space-between;padding:20px 24px;background:#f8fafc;border-bottom:1px solid #e2e8f0;flex-shrink:0}
.im-thread-title{font-weight:800;color:#0f172a;font-size:20px;letter-spacing:-0.02em}
.im-thread-close{width:40px;height:40px;border:none;background:#fff;color:#64748b;border-radius:12px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all 0.2s ease;box-shadow:0 1px 2px rgba(0,0,0,0.05)}
.im-thread-close:hover{background:#f1f5f9;color:#0f172a;transform:rotate(90deg)}
.im-thread-body{padding:24px;overflow-y:auto;flex:1;min-height:0;background:#ffffff;scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.im-thread-body::-webkit-scrollbar{width:6px}
.im-thread-body::-webkit-scrollbar-thumb{background-color:#cbd5e1;border-radius:10px}
.im-thread-list{display:flex;flex-direction:column;gap:20px}
.im-msg{display:flex;flex-direction:column;max-width:85%}
.im-msg-meta{font-size:12px;font-weight:600;color:#94a3b8;margin-bottom:4px;padding:0 4px}
.im-msg-bubble{padding:14px 18px;border-radius:20px;background:#f1f5f9;color:#1e293b;line-height:1.6;word-wrap:break-word;font-size:15px;box-shadow:0 1px 2px rgba(0,0,0,0.02)}
.im-from-lecturer{align-self:flex-end}
.im-from-lecturer .im-msg-meta{text-align:right;align-self:flex-end}
.im-from-lecturer .im-msg-bubble{background:#1e4a6e;color:#ffffff;border-bottom-right-radius:4px;box-shadow:0 4px 12px rgba(30,74,110,0.2)}
.im-msg:not(.im-from-lecturer) .im-msg-bubble{border-bottom-left-radius:4px;background:#f8fafc;border:1px solid #e2e8f0}
.im-report-btn{margin-top:8px;align-self:flex-start;border:1px solid #fee2e2;background:#fef2f2;color:#ef4444;font-size:12px;font-weight:700;cursor:pointer;padding:6px 12px;border-radius:10px;transition:all 0.2s ease;text-transform:uppercase;letter-spacing:0.05em;display:flex;align-items:center;gap:6px;box-shadow:0 1px 2px rgba(239,68,68,0.1)}
.im-report-btn:hover{background:#fee2e2;border-color:#fecaca;transform:translateY(-1px);box-shadow:0 4px 6px rgba(239,68,68,0.15)}
.im-report-btn::before{content:"⚠";font-size:14px}
.im-loading,.im-error{text-align:center;padding:40px;color:#64748b;font-weight:500}

/* Report Modal Styles */
.im-report-dialog{max-width:520px!important}
.im-report-label{display:block;font-size:14px;color:#374151;margin-bottom:8px;font-weight:500}
.im-report-textarea{width:100%;border:2px solid #e5e7eb;border-radius:12px;padding:12px 14px;font-size:15px;font-family:inherit;resize:vertical;min-height:120px;line-height:1.5}
.im-report-textarea:focus{outline:none;border-color:#1e4a6e;box-shadow:0 0 0 3px rgba(30,74,110,0.1)}
.im-report-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:16px}
.im-report-cancel{border:1px solid #d1d5db;background:#fff;color:#374151;border-radius:12px;padding:10px 16px;font-size:14px;cursor:pointer;transition:all 0.2s ease;font-weight:500}
.im-report-cancel:hover{background:#f9fafb;border-color:#9ca3af}

/* Tablet Optimierung */
@media (min-width: 769px) and (max-width: 1024px) {
  .im-messages-app.mini{margin:-12px;padding:0}
  .im-mini-header{margin:12px 12px 18px 12px}
  .im-tabs{margin:0 12px 18px 12px;gap:12px}
  .im-tab{padding:16px;min-width:64px}
  .im-card{padding:20px 18px;gap:16px;margin:12px;border-radius:18px;box-shadow:0 2px 8px rgba(0,0,0,0.08)}
  .im-card:hover{box-shadow:0 8px 25px rgba(0,0,0,0.15);transform:translateY(-2px)}
  .im-subject{font-size:18px}
  .im-meta{font-size:15px}
  .im-snippet{font-size:16px;margin-top:8px}
  .im-input{font-size:16px;min-height:50px;padding:14px 16px;border-radius:14px}
  .im-send-btn,.im-close-btn,.im-thread-btn,.im-withdraw-btn{width:50px;height:50px;border-radius:14px}
}

/* Mobile Optimierung */
@media (max-width: 768px) {
  .im-messages-app.mini{margin:-15px;padding:0}
  .im-mini-header{margin:15px 15px 20px 15px}
  .im-tabs{margin:0 15px 20px 15px;gap:10px}
  .im-tab{padding:14px;min-width:60px}
  .im-card{padding:18px 16px;gap:15px;margin:10px 10px;border-radius:18px;box-shadow:0 2px 8px rgba(0,0,0,0.1)}
  .im-card:hover{box-shadow:0 6px 20px rgba(0,0,0,0.15);transform:translateY(-2px)}
  .im-card.im-reported{box-shadow:0 3px 12px rgba(251,191,36,0.25)}
  .im-card.im-reported:hover{box-shadow:0 6px 24px rgba(251,191,36,0.35)}
  .im-subject{font-size:17px}
  .im-meta{font-size:14px;margin-top:3px}
  .im-snippet{font-size:15px;margin-top:8px}
  .im-replybar{margin-top:15px;gap:10px;flex-wrap:wrap}
  .im-input{font-size:16px;min-height:52px;padding:14px 16px;flex:1 1 100%;border-radius:14px}
  .im-send-btn,.im-close-btn,.im-thread-btn,.im-withdraw-btn{width:52px;height:52px;border-radius:14px}
  .im-replybar .im-send-btn{order:1}
  .im-replybar .im-close-btn{order:2}
  .im-replybar .im-thread-btn{order:3}
  .im-replybar .im-withdraw-btn{order:4}
  .im-empty{padding:50px 20px;font-size:16px}
}

/* Sehr kleine Bildschirme */
@media (max-width: 480px) {
  .im-messages-app.mini{margin:-15px;padding:0}
  .im-card{padding:16px 14px;margin:8px 8px;border-radius:16px}
  .im-mini-header{margin:15px 12px 18px 12px}
  .im-tabs{margin:0 12px 18px 12px}
  .im-replybar{gap:8px}
  .im-input{padding:12px 14px;min-height:48px;border-radius:12px}
  .im-send-btn,.im-close-btn,.im-thread-btn,.im-withdraw-btn{width:48px;height:48px;border-radius:12px}
}

.im-toast{position:fixed;left:50%;transform:translateX(-50%);bottom:20px;background:rgba(17,24,39,.95);color:#fff;padding:12px 18px;border-radius:12px;font-size:14px;display:none;z-index:9999;box-shadow:0 10px 25px rgba(0,0,0,0.2)}
