/* Modern 2026 Design - Vom Regen in die Traube */

:root {
    --primary-color: #8b5cf6;
    --secondary-color: #ec4899;
    --background-dark: #0a0a0a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --shadow-color: rgba(139, 92, 246, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--background-dark);
    color: var(--text-primary);
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Container */
.container {
    text-align: center;
    padding: 2rem;
    max-width: 900px;
    width: 90%;
    position: relative;
    z-index: 1;
}

/* Glass Card Effect */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 3rem 2rem;
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.37),
        0 0 60px var(--shadow-color);
    animation: cardFloat 6s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Header Image */
.header-image {
    margin-bottom: 2rem;
    position: relative;
}

.header-image img {
    max-width: 100%;
    max-height: 60vh;
    height: auto;
    object-fit: contain;
    border-radius: 20px;
    filter: drop-shadow(0 10px 30px rgba(139, 92, 246, 0.3));
    transition: transform 0.3s ease;
}

.header-image img:hover {
    transform: scale(1.02);
}

/* Title */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
    background-size: 200% 200%;
    letter-spacing: -0.02em;
}

/* Target Date Display */
.target-date {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text-secondary);
    margin: 0.5rem 0 1rem 0;
    font-weight: 500;
    letter-spacing: 0.02em;
    opacity: 0.9;
}

/* ICS Download Button */
.ics-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    margin: 0 0 1.5rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
}

.ics-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, #9d6fff, #f260ab);
}

.ics-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Countdown */
#countdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
}

.countdown-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.countdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    transition: left 0.5s ease;
}

.countdown-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.countdown-item:hover::before {
    left: 100%;
}

.countdown-number {
    display: block;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.countdown-label {
    display: block;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* Expired Message */
.expired-message {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Loading State */
.loading {
    font-size: 1.2rem;
    color: var(--text-secondary);
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .glass-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    #countdown {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .countdown-item {
        padding: 1rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 1rem;
    }
    
    #countdown {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Admin Button (for admin.html) */
.admin-form {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 500px;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

/* iOS Safari: Datumsfelder ignorieren sonst width:100 % und ragen über den Rand hinaus */
.form-group input[type="datetime-local"],
.form-group input[type="date"],
.form-group input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    max-width: 100%;
    min-width: 0;
    min-height: 3rem;
    text-align: left;
    box-sizing: border-box;
}

.form-group input[type="datetime-local"]::-webkit-date-and-time-value {
    text-align: left;
    min-height: 1.4em;
}

.btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    text-align: center;
}

.message.success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.back-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--secondary-color);
    transform: translateX(-5px);
}

/* ==========================================================================
   PWA, Push-Benachrichtigungen & erweiterter Admin-Bereich
   ========================================================================== */

[hidden] {
    display: none !important;
}

/* Aktions-Buttons auf der Startseite */
.action-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.action-row .ics-button {
    margin: 0;
}

.ics-button:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: -0.5rem auto 1.25rem;
    max-width: 520px;
    line-height: 1.5;
}

/* Admin-Layout */
.admin-container {
    max-width: 760px;
}

.admin-card {
    animation: none;
}

.admin-form .section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 1rem;
    padding-top: 0.25rem;
    text-align: left;
    color: var(--text-primary);
}

.admin-form .form-group + .section-title,
.admin-form .reminder-list + .section-title {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.sub-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    text-align: left;
}

.help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 1rem;
    text-align: left;
}

.help a {
    color: var(--primary-color);
}

code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.1em 0.35em;
    border-radius: 5px;
    word-break: break-all;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 1rem;
    cursor: pointer;
}

.checkbox-label input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.checkbox-label.compact {
    margin: 0;
    white-space: nowrap;
}

.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: vertical;
}

.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.btn + .btn {
    margin-top: 0.75rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
}

.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25);
    border-color: var(--primary-color);
}

.btn-small {
    width: auto;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

/* Erinnerungen */
.reminder-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.reminder-row {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-align: left;
}

.reminder-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.reminder-when {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.reminder-when-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.reminder-row input[type="text"],
.reminder-row input[type="number"],
.reminder-row select {
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.reminder-row input:focus,
.reminder-row select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.reminder-row input[type="number"] {
    width: 5rem;
}

.reminder-row input[type="text"] {
    width: 100%;
}

.reminder-row select {
    padding-right: 0.5rem;
}

.r-remove {
    margin-left: auto;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.r-remove:hover {
    color: #f87171;
    border-color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

.reminder-status {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.reminder-status.status-sent    { color: #4ade80; }
.reminder-status.status-due     { color: #60a5fa; }
.reminder-status.status-missed,
.reminder-status.status-skipped { color: #fbbf24; }
.reminder-status.status-invalid { color: #f87171; }

/* Status-Bereich */
.status-box {
    margin-top: 1.25rem;
    text-align: left;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-value.small {
    font-size: 0.95rem;
    -webkit-text-fill-color: var(--text-primary);
    background: none;
}

.input-row {
    display: flex;
    gap: 0.5rem;
}

.input-row input {
    flex: 1;
    min-width: 0;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.85rem;
}

.table-wrap {
    overflow-x: auto;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.log-table th,
.log-table td {
    padding: 0.5rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.log-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.log-table td:nth-child(3) {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-slot:empty {
    display: none;
}

@media (max-width: 480px) {
    .reminder-head {
        gap: 0.5rem;
    }
    .input-row {
        flex-direction: column;
    }
    .input-row .btn-small {
        width: 100%;
    }
}

.count-badge {
    display: inline-block;
    min-width: 1.6em;
    padding: 0.1em 0.5em;
    margin-left: 0.4rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-size: 0.8rem;
    text-align: center;
    vertical-align: middle;
}

/* Admin-Login & Kopfzeile */
.login-form {
    max-width: 420px;
}

.admin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 500px;
    margin: -0.5rem auto 0;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.admin-bar .btn-small {
    width: auto;
    margin: 0;
}

/* ==========================================================================
   Chat (Messenger-Layout) & Benutzerverwaltung
   ========================================================================== */

a.ics-button {
    text-decoration: none;
}

.help.center {
    text-align: center;
}

.admin-bar-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-bar-actions .btn-small {
    text-decoration: none;
}

/* --- Login / Registrierung (Chat-Seite) --- */
.chat-container {
    max-width: 760px;
    width: 100%;
}

.chat-card-auth {
    animation: none;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.auth-tab {
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border-color: transparent;
}

/* --- Messenger-Rahmen --- */
.chat-app {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    max-width: 860px;
    margin: 0 auto;
    background: #141219;
    z-index: 2;
}

@media (min-width: 900px) {
    .chat-app {
        top: 1.5rem;
        bottom: 1.5rem;
        border-radius: 24px;
        border: 1px solid var(--glass-border);
        overflow: hidden;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 60px var(--shadow-color);
    }
}

/* Kopfzeile */
.chat-topbar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.8rem;
    padding-top: calc(0.55rem + env(safe-area-inset-top));
    background: rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 5;
}

.topbar-back {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.9rem;
    line-height: 1;
    padding: 0 0.35rem 0.15rem 0.1rem;
    opacity: 0.85;
}

.topbar-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.topbar-info {
    flex: 1;
    min-width: 0;
    line-height: 1.25;
}

.topbar-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.topbar-menu-btn {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
}

.topbar-menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.topbar-dropdown {
    position: absolute;
    right: 0.8rem;
    top: calc(100% - 0.2rem);
    min-width: 220px;
    padding: 0.35rem;
    background: #1e1b26;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    z-index: 30;
}

.dropdown-user {
    padding: 0.55rem 0.9rem 0.6rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0.3rem;
}

.topbar-dropdown a,
.topbar-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.9rem;
    border: none;
    border-radius: 9px;
    background: none;
    color: var(--text-primary);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.topbar-dropdown a:hover,
.topbar-dropdown button:hover {
    background: rgba(255, 255, 255, 0.07);
}

/* Verlauf */
.chat-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.6rem 0.7rem 0.9rem;
    background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1.2px);
    background-size: 22px 22px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Dezenter Scrollbalken im Verlauf */
.chat-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.chat-scroll::-webkit-scrollbar {
    width: 6px;
}

.chat-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

.load-older-wrap {
    text-align: center;
}

.load-older {
    padding: 0.4rem 1rem;
    margin: 0.2rem 0 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

.chat-empty {
    text-align: center;
    color: var(--text-secondary);
    margin: 3rem 1rem;
    font-size: 0.9rem;
}

.day-sep {
    display: flex;
    justify-content: center;
    margin: 0.9rem 0 0.5rem;
}

.day-sep span {
    font-size: 0.72rem;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-secondary);
    backdrop-filter: blur(6px);
}

.msg-group {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    margin: 0.2rem 0;
}

.msg-group.own {
    justify-content: flex-end;
}

.msg-avatar {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    flex-shrink: 0;
    margin-bottom: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
}

.msg-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    max-width: min(80%, 480px);
}

.msg-group.own .msg-stack {
    align-items: flex-end;
}

/* Sprechblasen */
.bubble {
    position: relative;
    max-width: 100%;
    padding: 0.32rem 0.55rem 0.3rem 0.6rem;
    border-radius: 14px;
    background: #27242f;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
    overflow-wrap: anywhere;
    outline: none;
}

.msg-group.own .bubble {
    background: linear-gradient(135deg, #6f4fd8, #b8489b);
}

.msg-group.other .bubble:last-child {
    border-bottom-left-radius: 4px;
}

.msg-group.own .bubble:last-child {
    border-bottom-right-radius: 4px;
}

/* Schwänzchen an der letzten Blase einer Gruppe */
.msg-group.other .bubble:last-child::before,
.msg-group.own .bubble:last-child::before {
    content: '';
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 12px;
}

.msg-group.other .bubble:last-child::before {
    left: -6px;
    background: #27242f;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.msg-group.own .bubble:last-child::before {
    right: -6px;
    background: #b8489b;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.bubble-sender {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.05rem;
    padding-right: 1.2rem;
}

.msg-group.other .bubble:not(:first-child) .bubble-sender {
    display: none;
}

.bubble-badge {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.02rem 0.35rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.35);
    color: #e9d5ff;
    vertical-align: middle;
}

.bubble-text {
    white-space: pre-wrap;
}

.bubble-text a {
    color: #c4b5fd;
}

.msg-group.own .bubble-text a {
    color: #fde7f3;
}

/* Platzhalter am Textende, damit die Uhrzeit nie über dem Text liegt */
.bubble-spacer {
    display: inline-block;
    width: 3.6em;
    height: 0.6em;
}

.msg-group.other .bubble-spacer {
    width: 2.9em;
}

.bubble-meta {
    position: absolute;
    right: 0.5rem;
    bottom: 0.18rem;
    display: flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}

.msg-group.own .bubble-meta {
    color: rgba(255, 255, 255, 0.75);
}

.tick {
    font-size: 0.72rem;
}

.bubble.pending {
    opacity: 0.65;
}

/* Bilder in Blasen */
.bubble-image {
    margin: -0.12rem -0.35rem 0.3rem -0.4rem;
}

.bubble.has-image {
    width: 300px;
    max-width: 100%;
}

.bubble-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    cursor: zoom-in;
    background: rgba(0, 0, 0, 0.2);
}

.bubble.image-only .bubble-image {
    margin-bottom: -0.1rem;
}

.bubble.image-only .bubble-meta {
    right: 0.55rem;
    bottom: 0.45rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}

/* Nur Emojis: groß, ohne Blase (Spezifität höher als die Gruppen-Regeln) */
.msg-group .bubble.bubble-jumbo {
    background: transparent;
    box-shadow: none;
    padding: 0 0.2rem;
}

.msg-group .bubble.bubble-jumbo::before {
    display: none;
}

.bubble-jumbo .bubble-text {
    font-size: 2.8rem;
    line-height: 1.15;
}

.bubble-jumbo .bubble-spacer {
    display: none;
}

.bubble-jumbo .bubble-meta {
    position: static;
    justify-content: flex-end;
    margin-top: -0.2rem;
}

.msg-group.other .bubble-jumbo .bubble-sender {
    padding-right: 0;
}

/* Optionen-Pfeil (Desktop: bei Hover) */
.bubble-menu-btn {
    position: absolute;
    top: 0.1rem;
    right: 0.25rem;
    padding: 0 0.25rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.2;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.bubble:hover .bubble-menu-btn,
.bubble:focus-visible .bubble-menu-btn {
    opacity: 1;
}

@media (hover: none) {
    .bubble-menu-btn {
        display: none;
    }
}

/* Nach-unten-Knopf */
.scroll-down {
    position: absolute;
    right: 1rem;
    bottom: 5rem;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: #1e1b26;
    color: var(--text-primary);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    z-index: 4;
}

.scroll-down .badge {
    position: absolute;
    top: -0.45rem;
    right: -0.3rem;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--secondary-color);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-down .badge:empty {
    display: none;
}

/* Eingabeleiste */
.chat-inputbar {
    padding: 0.5rem 0.6rem calc(0.5rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.045);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.composer {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
}

.composer-attach {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.composer-attach:hover {
    background: rgba(255, 255, 255, 0.07);
}

.composer textarea {
    flex: 1;
    min-height: 2.5rem;
    max-height: 160px;
    padding: 0.62rem 0.95rem;
    border-radius: 1.25rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font: inherit;
    font-size: 1rem;
    line-height: 1.3;
    resize: none;
    overflow-y: hidden;
}

.composer textarea:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.6);
}

.composer-send {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    flex-shrink: 0;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.composer-send:hover {
    transform: scale(1.06);
}

.composer-send:disabled {
    opacity: 0.6;
    transform: none;
}

.image-preview {
    position: relative;
    display: inline-block;
    margin: 0 0 0.5rem 0.5rem;
}

.image-preview img {
    max-height: 120px;
    max-width: 200px;
    border-radius: 10px;
    display: block;
}

.image-preview .r-remove {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 1.7rem;
    height: 1.7rem;
    background: var(--background-dark);
    font-size: 0.8rem;
}

.chat-inputbar .message-slot .message {
    margin-top: 0.5rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

/* Kamera-Knopf nur auf Touch-Geräten (am Desktop wäre es nur ein zweiter Dateidialog) */
.composer-camera {
    margin-left: -0.3rem;
}

@media (hover: hover) and (pointer: fine) {
    .composer-camera {
        display: none;
    }
}

/* Kontextmenü */
.msg-menu {
    position: fixed;
    z-index: 90;
    min-width: 190px;
    padding: 0.3rem;
    background: #1e1b26;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.msg-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.9rem;
    border: none;
    border-radius: 9px;
    background: none;
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
}

.msg-menu button:hover {
    background: rgba(255, 255, 255, 0.07);
}

.msg-menu button.danger {
    color: #f87171;
}

.msg-menu button.danger.confirm {
    background: rgba(239, 68, 68, 0.2);
}

/* Bier-Snake */
.game-overlay {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    background: rgba(5, 4, 8, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.game-panel {
    width: 100%;
    max-width: 440px;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.6rem 0.6rem 0.8rem;
    border-radius: 18px;
    background: #1e1b26;
    border: 1px solid var(--glass-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.game-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.2rem 0.2rem 0.5rem;
}

.game-title {
    font-weight: 600;
}

.game-stats {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.game-close {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

#gameCanvas {
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    background: #141219;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.game-msg {
    margin: 0.6rem 0 0;
    min-height: 1.3em;
    font-size: 0.9rem;
    color: #fbbf24;
}

.game-dpad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.6rem;
}

.game-dpad-row {
    display: flex;
    gap: 3.2rem;
}

.game-dpad button {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    touch-action: manipulation;
}

.game-dpad button:active {
    background: rgba(139, 92, 246, 0.5);
}

@media (hover: hover) and (pointer: fine) {
    .game-dpad {
        display: none;
    }
}

.game-hint {
    margin: 0.6rem 0 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Pilsener-Spiel im Overlay */
.pils-overlay {
    padding: 0.5rem;
    padding-top: max(0.5rem, env(safe-area-inset-top));
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.pils-frame {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 980px;
    border-radius: 18px;
    overflow: hidden;
    background: #0c2414;
    border: 1px solid var(--glass-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.pils-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.pils-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Vollbild-Ansicht */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.93);
    cursor: zoom-out;
}

.lightbox img {
    max-width: 96vw;
    max-height: 84vh;
    object-fit: contain;
    border-radius: 6px;
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: max(1rem, env(safe-area-inset-top));
    right: 1rem;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.lightbox-caption {
    margin-top: 0.8rem;
    padding: 0 1rem;
    max-width: 90vw;
    color: #ddd;
    font-size: 0.85rem;
    text-align: center;
    cursor: default;
}

/* --- Benutzerverwaltung (Admin) --- */
.users-table td {
    white-space: nowrap;
}

.user-inactive td:not(.user-actions) {
    opacity: 0.5;
}

.user-actions {
    display: flex;
    gap: 0.3rem;
}

.btn-mini {
    width: auto;
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
    margin: 0 !important;
}

.btn-danger:hover {
    border-color: #f87171;
    color: #f87171;
}

.create-user-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.create-user-form .form-group:nth-child(-n+4) {
    margin-bottom: 1rem;
}

.create-user-form button,
.create-user-form .message-slot {
    grid-column: 1 / -1;
}

.user-password-row td {
    padding-top: 0;
}

@media (max-width: 600px) {
    .msg-stack {
        max-width: 86%;
    }
    .create-user-form {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Chat: Antworten (Zitat, Wischen) & Emoji-Reaktionen
   ========================================================================== */

/* Zitat der beantworteten Nachricht oben in der Blase */
.bubble-quote {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0.15rem 0 0.35rem;
    padding: 0.3rem 0.55rem 0.32rem 0.5rem;
    border-left: 3px solid var(--primary-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    font-size: 0.8rem;
    line-height: 1.3;
    cursor: pointer;
    max-width: 100%;
    min-width: 8rem;
}

.msg-group.own .bubble-quote {
    border-left-color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.18);
}

.bubble-quote-name {
    font-weight: 600;
    color: #c4b5fd;
}

.msg-group.own .bubble-quote-name {
    color: #fff;
}

.bubble-quote-text {
    color: rgba(255, 255, 255, 0.78);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.bubble.has-image .bubble-quote {
    margin-right: -0.05rem;
}

/* Kurzes Aufleuchten, wenn zur zitierten Nachricht gesprungen wird */
.bubble.highlight {
    animation: bubbleFlash 1.6s ease;
}

@keyframes bubbleFlash {
    0%   { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.9); }
    30%  { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.7); }
    100% { box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3); }
}

/* Wischen nach rechts (Touch): Blase folgt dem Finger, links erscheint ein Antworten-Symbol */
.bubble {
    touch-action: pan-y;
    transition: transform 0.2s ease;
}

.bubble.swiping {
    transition: none;
}

.bubble.swiping::after {
    content: '↩';
    position: absolute;
    left: -2.3rem;
    top: 50%;
    width: 1.8rem;
    height: 1.8rem;
    margin-top: -0.9rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1rem;
    line-height: 1.8rem;
    text-align: center;
    opacity: 0.45;
    transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.bubble.swipe-ready::after {
    opacity: 1;
    background: var(--primary-color);
    transform: scale(1.1);
}

/* Reaktions-Chips überlappen die Unterkante der Blase */
.bubble.has-reactions {
    margin-bottom: 1rem;
}

.bubble-reactions {
    position: absolute;
    left: 0.4rem;
    bottom: -0.9rem;
    display: flex;
    gap: 3px;
    z-index: 1;
}

.msg-group.own .bubble-reactions {
    left: auto;
    right: 0.4rem;
}

.bubble-reactions:empty {
    display: none;
}

.reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    border: 1.5px solid #141219;
    background: #33303d;
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    line-height: 1.3;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    transition: transform 0.12s ease;
}

.reaction-chip:hover {
    transform: scale(1.08);
}

.reaction-chip.mine {
    background: #4c3d8f;
    border-color: var(--primary-color);
}

.reaction-chip span {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.85);
}

.bubble-jumbo .bubble-reactions {
    bottom: -0.6rem;
}

/* Reaktionsleiste oben im Kontextmenü */
.msg-menu {
    max-width: calc(100vw - 16px);
}

.msg-menu-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
    padding: 0.15rem 0.25rem 0.35rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.msg-menu-reactions button {
    width: 2.2rem;
    height: 2.2rem;
    border: none;
    border-radius: 50%;
    background: none;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease;
}

.msg-menu-reactions button:hover {
    transform: scale(1.25);
    background: rgba(255, 255, 255, 0.08);
}

.msg-menu-reactions button.mine {
    background: rgba(139, 92, 246, 0.4);
}

/* Antwort-Vorschau über dem Eingabefeld */
.reply-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0.15rem 0.45rem;
    padding: 0.35rem 0.45rem 0.35rem 0;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
}

.reply-preview-bar {
    width: 3px;
    align-self: stretch;
    margin-left: 0.45rem;
    border-radius: 2px;
    background: var(--primary-color);
}

.reply-preview-body {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
    line-height: 1.3;
}

.reply-preview-name {
    font-weight: 600;
    color: #c4b5fd;
}

.reply-preview-text {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview .r-remove {
    width: 1.7rem;
    height: 1.7rem;
    font-size: 0.8rem;
    margin: 0;
}

/* ==========================================================================
   Admin-Bereich: Sprungleiste & Mobil-Layout
   ========================================================================== */

.admin-nav {
    position: sticky;
    top: 0;
    z-index: 6;
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.6rem 0.25rem;
    margin: 0.75rem -0.25rem 0;
    background: rgba(16, 14, 22, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.admin-nav::-webkit-scrollbar {
    display: none;
}

.admin-nav a {
    flex-shrink: 0;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.admin-nav a:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: var(--primary-color);
}

.admin-card .section-title,
.admin-card section {
    scroll-margin-top: 4.5rem;
}

.muted {
    color: var(--text-secondary);
}

@media (max-width: 600px) {
    .admin-container {
        width: 100%;
        padding: 0.5rem 0.5rem 1.5rem;
    }

    .admin-card {
        padding: 1.1rem 0.8rem 1.5rem;
        border-radius: 16px;
    }

    .admin-card h1 {
        font-size: 1.6rem;
        margin: 0.5rem 0 1rem;
    }

    .admin-form {
        padding: 1rem 0.85rem;
        margin: 1rem 0;
        border-radius: 14px;
        max-width: none;
    }

    .admin-bar {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        max-width: none;
        margin-top: 0;
    }

    .admin-bar-actions {
        width: 100%;
    }

    .admin-bar-actions .btn-small {
        flex: 1;
        text-align: center;
    }

    .admin-nav {
        top: env(safe-area-inset-top, 0);
    }

    /* Kein automatischer Zoom auf iOS: Eingabefelder mindestens 16 px */
    .admin-card input:not([type="checkbox"]),
    .admin-card select,
    .admin-card textarea {
        font-size: 16px;
    }

    .reminder-row input[type="number"] {
        width: 4.5rem;
    }

    .status-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat:first-child {
        grid-column: 1 / -1;
    }

    /* Tabellen als Karten: jede Zeile ein Kästchen, Spaltenname vor dem Wert */
    .log-table.stack thead {
        display: none;
    }

    .log-table.stack,
    .log-table.stack tbody,
    .log-table.stack tr,
    .log-table.stack td {
        display: block;
        width: 100%;
    }

    .log-table.stack tr {
        padding: 0.6rem 0.75rem;
        margin-bottom: 0.6rem;
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.03);
    }

    .log-table.stack td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.75rem;
        padding: 0.18rem 0;
        border: none;
        white-space: normal;
        max-width: none;
        font-size: 0.88rem;
        text-align: right;
    }

    .log-table.stack td::before {
        content: attr(data-label);
        flex-shrink: 0;
        color: var(--text-secondary);
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        text-align: left;
    }

    .log-table.stack td.user-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.4rem;
        padding-top: 0.6rem;
    }

    .log-table.stack td.user-actions::before {
        display: none;
    }

    .log-table.stack td.user-actions .btn-mini {
        flex: 1 1 40%;
        padding: 0.55rem 0.5rem;
        font-size: 0.85rem;
    }

    .log-table.stack .user-password-row {
        margin-top: -0.4rem;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    .log-table.stack .user-password-row td {
        display: block;
        padding: 0;
        text-align: left;
    }

    .log-table.stack .user-password-row td::before {
        display: none;
    }
}
