/* ============================================
   MSGS.AT v2 - Swiss Editorial Design System
   ============================================ */

/* Skip Link (WCAG 2.4.1) */
.skip-link {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateY(-100%);
    background: var(--color-primary);
    color: var(--color-bg);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    z-index: 9999;
}
.skip-link:focus { transform: translateY(0); }

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

/* Custom Properties */
:root {
    --color-primary: #000000;
    --color-bg: #ffffff;
    --color-accent: #ff0000;
    --color-gray: #cccccc;
    --color-text-secondary: #333333;
    --color-border: #e0e0e0;
    --color-surface: #f5f5f5;
    --gray-100: #f5f5f5;
    --gray-200: #e0e0e0;
    --grid-gap: 20px;
    --font-stack: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Arial', sans-serif;
    --font-mono: 'Courier New', monospace;
}

/* Base */
body {
    font-family: var(--font-stack);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-primary);
    background: var(--color-bg);
    height: 100vh;
    height: 100dvh;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

h2 {
    font-size: 18px;
    font-weight: 400;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

/* ============================================
   Layout — Fullscreen Map
   ============================================ */

#appContainer {
    height: 100vh;
    height: 100dvh;
}

#map {
    width: 100%;
    height: 100%;
    background: var(--gray-100);
    position: relative;
    z-index: 1;
}

/* Map Topbar */
.map-topbar {
    position: absolute;
    top: var(--grid-gap);
    right: var(--grid-gap);
    z-index: 1000;
    display: flex;
    gap: 8px;
    align-items: center;
}

.demo-notice {
    background: var(--color-primary);
    color: var(--color-bg);
    padding: 0 16px;
    height: 40px;
    display: flex;
    align-items: center;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.recenter-btn {
    background: var(--color-bg);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    width: 40px;
    min-height: 40px;
    height: 40px;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-transform: none;
    letter-spacing: 0;
}

.recenter-btn:hover {
    background: var(--color-primary);
    color: var(--color-bg);
}

.recenter-btn:active { transform: scale(0.95); }

/* ============================================
   FABs — Create (left), Menu (right)
   ============================================ */

.fab {
    position: absolute !important;
    right: 20px !important;
    bottom: 20px !important;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-bg);
    border: none;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    z-index: 5000 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.fab:hover { transform: scale(1.05); }
.fab:active { transform: scale(0.95); }

.fab:disabled {
    background: var(--color-gray);
    cursor: not-allowed;
    box-shadow: none;
}

.fab:disabled:hover { transform: none; }

/* Create FAB — left side */
.fab-left {
    left: 20px !important;
    right: auto !important;
}

/* Menu FAB — right side (default), white bg */
.fab-menu {
    background: var(--color-bg);
    border: 2px solid var(--color-primary);
}

.fab-menu:hover {
    background: var(--gray-100);
    transform: scale(1.05);
}

.fab-menu .hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
    height: 14px;
    justify-content: space-between;
}

.fab-menu .hamburger::before,
.fab-menu .hamburger span,
.fab-menu .hamburger::after {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}

.fab-menu .hamburger span { height: 2px; }

/* ============================================
   Side Panel (replaces sidebar + menu)
   ============================================ */

.side-panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 8999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.side-panel-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    background: var(--color-bg);
    border-inline-start: 2px solid var(--color-primary);
    z-index: 9000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.side-panel.active {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 12px var(--grid-gap);
    border-bottom: 1px solid var(--gray-200);
}

.panel-close {
    width: auto;
    padding: 0;
    background: none;
    color: var(--color-primary);
    font-size: 32px;
    line-height: 1;
    font-weight: 300;
    border: none;
    cursor: pointer;
    min-height: auto;
    transition: color 0.15s;
}

.panel-close:hover {
    color: var(--color-accent);
    background: none;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
}

.panel-section {
    padding: var(--grid-gap);
    border-bottom: 1px solid var(--gray-200);
}

.panel-section:last-child { border-bottom: none; }

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text-secondary);
}

/* Panel Menu Items */
.panel-menu-item {
    display: block;
    padding: 12px 0;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    border-bottom: 1px solid var(--gray-200);
    transition: color 0.15s;
}

.panel-menu-item:last-child { border-bottom: none; }
.panel-menu-item:hover { color: var(--color-accent); }

/* Location Info */
.username {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: color 0.15s;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Button reset */
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    min-height: auto;
    text-transform: none;
    text-align: left;
}

.username:hover { color: var(--color-accent); }

.location-info {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.8;
}

.location-info p { margin: 4px 0; }

.location-info strong {
    display: inline-block;
    min-width: 80px;
    font-weight: 400;
    margin-inline-end: 8px;
}

/* Status */
.status-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    height: 30px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    flex: 1;
}

.status.success {
    background: var(--color-primary);
    color: var(--color-bg);
}

.status.error {
    background: var(--color-accent);
    color: var(--color-bg);
}

.status.loading {
    background: var(--gray-200);
    color: var(--color-primary);
}

.status-button {
    width: auto;
    padding: 0 10px;
    height: 30px;
    background: var(--color-primary);
    color: var(--color-bg);
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    text-transform: none;
    letter-spacing: 0;
    min-height: auto;
    display: inline-flex;
    align-items: center;
}

.status-button:hover { background: var(--color-text-secondary); }

/* ============================================
   Message Cards — One-line format
   ID · Distance · Time · Flags
   ============================================ */

.message-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: color 0.15s;
    font-size: 14px;
    /* Button reset */
    background: none;
    color: var(--color-primary);
    border-radius: 0;
    min-height: auto;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    text-align: left;
    width: 100%;
}

.message-card:last-child { border-bottom: none; }
.message-card:hover { color: var(--color-accent); }

.message-card:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.msg-id {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13px;
}

.msg-dist {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.msg-time {
    font-size: 12px;
    font-family: var(--font-mono);
}

.msg-emoji {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.msg-flags {
    margin-inline-start: auto;
    font-size: 14px;
    white-space: nowrap;
}

/* ============================================
   Leaflet Overrides
   ============================================ */

.leaflet-container {
    background: var(--gray-100);
    font-family: var(--font-stack);
}

.leaflet-control-zoom {
    border: 1px solid var(--color-primary) !important;
    box-shadow: none !important;
}

.leaflet-control-zoom a {
    background: var(--color-bg) !important;
    color: var(--color-primary) !important;
    border-bottom: 1px solid var(--color-primary) !important;
}

.leaflet-control-zoom a:hover { background: var(--gray-100) !important; }

/* ============================================
   Loading Overlay
   ============================================ */

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 15000;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active { display: flex; }

.loading-bounce {
    position: relative;
    width: 100%;
    height: 60%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-circle {
    width: 80px;
    height: 80px;
    background: var(--color-bg);
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 600;
    color: var(--color-primary);
    animation: bounce 1s ease-in-out infinite;
}

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

/* ============================================
   Buttons
   ============================================ */

button {
    width: 100%;
    background: var(--color-primary);
    color: var(--color-bg);
    border: none;
    padding: 16px;
    min-height: 52px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

button:hover { background: var(--color-text-secondary); }
button:active { background: var(--color-primary); }

button:disabled {
    background: var(--gray-200);
    color: var(--color-text-secondary);
    cursor: not-allowed;
}

button.secondary {
    background: var(--color-bg);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    margin-top: 0;
}

button.secondary:hover { background: var(--gray-100); }

/* ============================================
   Modal
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active { display: flex; }
.modal-no-close .modal-close { display: none; }

.modal-content {
    background: var(--color-bg);
    border: 2px solid var(--color-primary);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px var(--grid-gap);
    border-bottom: 1px solid var(--color-primary);
}

.modal-body {
    padding: 24px var(--grid-gap);
}

.modal-body p { margin: 0; }

.modal-close {
    width: auto;
    padding: 0;
    background: none;
    color: var(--color-primary);
    font-size: 32px;
    line-height: 1;
    font-weight: 300;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    min-height: auto;
}

.modal-close:hover {
    color: var(--color-accent);
    background: none;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 12px var(--grid-gap);
    border-top: 1px solid var(--gray-200);
}

.modal-footer button { flex: 1; }
.modal-footer button.delete-btn {
    background: var(--color-accent);
    color: var(--color-bg);
}
.modal-footer button.delete-btn:hover { background: #cc0000; }

/* ============================================
   Form
   ============================================ */

form { padding: var(--grid-gap); }

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text-secondary);
}

.form-group textarea,
.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-primary);
    background: var(--color-bg);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.form-group textarea:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-primary);
    background: var(--color-bg);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.char-counter {
    text-align: right;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--color-text-secondary);
    margin-top: 4px;
    transition: color 0.2s;
}

.char-counter.near-limit {
    color: var(--color-accent);
    font-weight: 600;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.form-help {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-top: 4px;
    margin-inline-start: 32px;
}

.form-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.option-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.option-field {
    flex: 1;
    height: 44px;
    padding: 0 12px;
    border: 2px solid var(--gray-200);
    background: var(--color-bg);
    font-family: var(--font-stack);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--color-primary);
}

.option-field:focus {
    outline: none;
    border-color: var(--color-primary);
}

.option-label {
    display: flex;
    align-items: center;
}

.option-row:has(.option-toggle input:checked) .option-field {
    border-color: var(--color-primary);
}

.option-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    width: 44px;
    height: 44px;
    border: 2px solid var(--gray-200);
    transition: all 0.15s;
    user-select: none;
}

.option-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-toggle:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--gray-100);
}

.form-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 24px 0;
}

/* Emoji Picker Grid */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 4px;
}

.emoji-option {
    width: auto;
    min-height: auto;
    padding: 8px;
    font-size: 28px;
    background: none;
    color: var(--color-primary);
    border: 2px solid transparent;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    transition: all 0.15s;
    line-height: 1;
}

.emoji-option:hover {
    background: var(--gray-100);
}

.emoji-option.selected {
    border-color: var(--color-primary);
    background: var(--gray-100);
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--color-primary);
    color: var(--color-bg);
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    pointer-events: auto;
    animation: toastIn 0.2s ease-out;
}

.toast.removing {
    animation: toastOut 0.2s ease-in forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

.toast.toast-warning {
    background: var(--color-accent);
}

.toast.toast-update {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.toast-btn {
    background: var(--color-bg);
    color: var(--color-primary);
    border: none;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-transform: uppercase;
    align-self: stretch;
    text-align: center;
}

.toast-btn:hover {
    background: var(--color-gray);
}

.demo-notice.offline {
    background: var(--color-accent);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-primary); }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-secondary); }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .map-topbar {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: calc(10px + env(safe-area-inset-right, 0px));
    }

    .demo-notice {
        font-size: 9px;
        padding: 8px 12px;
    }

    .fab {
        right: calc(10px + env(safe-area-inset-right, 0px)) !important;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        width: 56px;
        height: 56px;
        font-size: 28px;
        z-index: 5000 !important;
    }

    .fab-left {
        left: calc(10px + env(safe-area-inset-left, 0px)) !important;
        right: auto !important;
    }

    .side-panel { width: 85%; }

    .modal-content {
        max-width: 100%;
        max-height: 95vh;
        max-height: 95dvh;
    }

    .loading-circle {
        width: 60px;
        height: 60px;
        font-size: 32px;
    }
}

/* Small phones */
@media (max-width: 375px) {
    .panel-section { padding: 12px; }
    .location-info { font-size: 12px; }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal.active .modal-content { animation: fadeIn 0.2s ease-out; }

/* Denied State (Gate 1 rejected) */
body.denied {
    background: var(--color-primary);
}

body.denied #appContainer,
body.denied .fab,
body.denied .loading-overlay {
    display: none;
}

.denied-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-primary);
    color: var(--color-bg);
    z-index: 20000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--grid-gap);
    gap: 24px;
}

body.denied .denied-screen { display: flex; }

.denied-screen p {
    font-size: 14px;
    line-height: 1.6;
    max-width: 300px;
}

.denied-screen button {
    width: auto;
    padding: 16px 32px;
    background: var(--color-bg);
    color: var(--color-primary);
}

/* ==========================================
   Settings Modal — Transfer Codes
   ========================================== */

.settings-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
}
.settings-section:last-child { border-bottom: none; }
.settings-section h3 { font-size: 13px; letter-spacing: 0.08em; margin-bottom: 6px; }
.settings-desc { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 12px; }

.transfer-code-display {
    font-family: var(--font-mono);
    font-size: 28px;
    letter-spacing: 0.25em;
    text-align: center;
    padding: 12px 8px;
    margin: 12px 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-primary);
    user-select: all;
}
.transfer-countdown {
    text-align: center;
    font-size: 12px;
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
    margin-bottom: 8px;
}

/* ==========================================
   Sidebar Accordion (Settings Menu) — P1-011
   ========================================== */

.panel-menu-accordion {
    border-bottom: 1px solid var(--gray-200);
}

.panel-accordion-toggle {
    width: 100%;
    background: none;
    border: none;
    border-bottom: none !important;
    padding: 12px 0;
    color: var(--color-primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    appearance: none;
    -webkit-appearance: none;
}

.panel-accordion-toggle:focus { outline: none; }
.panel-accordion-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.panel-accordion-toggle:hover,
.panel-accordion-toggle:active { background: none; }

.accordion-arrow {
    font-size: 10px;
    transition: transform 0.2s;
    display: inline-block;
    flex-shrink: 0;
}

.panel-menu-accordion.open .accordion-arrow {
    transform: rotate(90deg);
}

.panel-accordion-body {
    padding-bottom: 4px;
}

.panel-menu-subitem {
    display: block;
    padding: 8px 0 8px 12px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    transition: color 0.15s;
}

.panel-menu-subitem:hover { color: var(--color-accent); }

/* ==========================================
   Map Topbar Button (Refresh) — P1-012
   ========================================== */

.topbar-btn {
    background: var(--color-bg);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    width: 40px;
    min-height: 40px;
    height: 40px;
    padding: 0;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: none;
    letter-spacing: 0;
}

.topbar-btn:hover {
    background: var(--color-primary);
    color: var(--color-bg);
}

.topbar-btn:active { transform: scale(0.95); }

/* Location Status Error State — P1-012 */
.demo-notice.error {
    background: var(--color-accent);
}

/* ==========================================
   Block Feature — P2-002
   ========================================== */

/* Author-Card Button im Read-Modal */
.author-card-btn {
    font-size: 16px;
    cursor: pointer;
    display: inline-block;
    width: auto;
    min-height: auto;
    padding: 2px 4px;
    border-radius: 2px;
    border: none;
    background: none;
    color: inherit;
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
    transition: background 0.15s;
}
.author-card-btn:hover { background: var(--gray-100); }

/* User Card Modal */
#userCardModal .modal-footer {
    justify-content: center;
}
#userCardBlockBtn {
    width: auto;
    min-height: auto;
    padding: 10px 24px;
}
.user-card-avatar { text-align: center; padding: 24px 0 16px; }
.user-card-emoji { font-size: 48px; margin-bottom: 12px; line-height: 1; }
.user-card-name {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}

/* Blocklist Modal */
.blocklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
    gap: 12px;
}
.blocklist-item:last-child { border-bottom: none; }
.blocklist-user { font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Utility classes — replaces inline styles in JS template strings and HTML
   Added: Audit Prompt 4 (CSP unsafe-inline removal)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Empty / loading states */
.msg-empty-state {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-style: italic;
}
.text-sm-muted {
  font-size: 13px;
  color: var(--color-text-secondary);
}
.text-sm-error {
  font-size: 13px;
  color: var(--color-accent);
}

/* Text display */
.text-preformatted {
  white-space: pre-line;
  line-height: 1.6;
}

/* ToS / install modal text (also used in index.html static) */
.tos-body-text {
  margin-bottom: 16px;
  line-height: 1.6;
}
.tos-detail-text {
  line-height: 1.6;
  font-size: 14px;
  color: #333;
}

/* Static HTML */
.text-caps-wide {
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.import-error-text {
  color: var(--color-accent);
  font-size: 12px;
  margin-top: 8px;
  font-weight: 600;
}

/* Read modal */
.emoji-lg { font-size: 16px; }
.msg-read-body {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
}
.msg-read-meta {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  line-height: 1.8;
}
.msg-burn-notice {
  color: var(--color-accent);
  font-weight: 600;
}

/* Password prompt */
.mb-12 { margin-bottom: 12px; }
.mb-0  { margin-bottom: 0; }
.password-input-field {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-primary);
  font-family: inherit;
  font-size: 14px;
}
.input-error-text {
  color: var(--color-accent);
  font-size: 12px;
  margin-top: 8px;
  font-weight: 600;
}

/* Blocklist / Subscriptions action buttons */
.btn-compact {
  font-size: 12px;
  padding: 6px 12px;
  min-height: auto;
  width: auto;
}

/* ============================================
   WCAG: Focus Visible — keyboard only (2.4.7)
   Adds explicit outline for keyboard navigation on top of
   existing border-color change (which covers mouse users).
   ============================================ */
.form-group textarea:focus-visible,
.form-group input:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
}
.option-field:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
}

/* ============================================
   WCAG: Reduced Motion (2.3.3)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .side-panel {
        transition: none;
    }
    .modal {
        transition: none;
    }
    .toast {
        animation: none;
    }
}
