/* ==========================================
   HERMYON PWA — HomeGarden.bio Design System
   Premium Nature Design, Mobile-First
   ========================================== */

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

/* ---- Design Tokens ---- */
:root {
    /* Primary Palette — Relaunch 2026: Moos-Grün (statt Türkis) */
    --color-primary: #23381f;
    --color-primary-light: #2f5028;
    --color-primary-faint: rgba(35, 56, 31, 0.08);
    --color-primary-glow: rgba(35, 56, 31, 0.22);

    /* Greens */
    --color-green-dark: #15241c;
    --color-green-mid: #2f5028;
    --color-green-light: #4a7a3d;

    /* Neutrals — Bone/Ink */
    --color-cream: #f4efe4;
    --color-cream-dark: #ece6d6;
    --color-white: #ffffff;
    --color-dark: #161a14;
    --color-gray: #6a6a5e;
    --color-gray-light: #a3a094;
    --color-border: rgba(22, 26, 20, 0.09);

    /* Accent — Gold (statt Terrakotta-Türkis) */
    --color-accent: #c98a2e;
    --color-accent-soft: rgba(201, 138, 46, 0.13);
    --color-accent-pale: rgba(201, 138, 46, 0.06);
    --color-bone-deep: #e2dac8;
    --color-terracotta: #c4694a;
    --color-error: #c4694a;

    /* Typography — Relaunch 2026 */
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(35, 56, 31, 0.15);

    /* Safe Areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- Base ---- */
html {
    font-size: 16px;
    height: 100%;
    height: -webkit-fill-available;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-dark);
    background: var(--color-cream);
    overflow-x: hidden;
    overflow-y: hidden;
    max-width: 100vw;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Botanical Background ---- */
.botanical-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    width: 100vw;
    max-width: 100vw;
}

.botanical-blob {
    position: absolute;
    color: var(--color-primary);
    opacity: 0.04;
    filter: blur(60px);
    animation: blobFloat 20s ease-in-out infinite;
}

.botanical-blob--1 {
    width: 300px;
    height: 300px;
    top: -80px;
    right: -60px;
    animation-delay: 0s;
}

.botanical-blob--2 {
    width: 250px;
    height: 250px;
    bottom: 15%;
    left: -80px;
    opacity: 0.03;
    animation-delay: -7s;
    animation-duration: 25s;
}

.botanical-blob--3 {
    width: 180px;
    height: 180px;
    bottom: -40px;
    right: 20%;
    opacity: 0.035;
    animation-delay: -14s;
    animation-duration: 22s;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(15px, -20px) scale(1.05); }
    66% { transform: translate(-10px, 10px) scale(0.95); }
}

/* ---- App Container ---- */
.app-container {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    width: 100%;
    overflow-x: hidden;
    margin: 0 auto;
    z-index: 1;
}

/* ---- Header ---- */
.app-header {
    background: rgba(248, 246, 240, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-xs) var(--space-sm);
    padding-top: max(var(--space-sm), calc(var(--safe-top) + 4px));
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: hidden;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    font-style: italic;
    color: var(--color-green-dark);
    letter-spacing: -0.01em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.header-device-id {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-gray);
    font-family: var(--font-body);
    letter-spacing: 0.03em;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-gray-light);
    transition: background 0.3s ease;
}

.status-dot.online {
    background: var(--color-primary);
    box-shadow: 0 0 6px var(--color-primary-glow);
    animation: statusPulse 3s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--color-error);
}

.status-dot.thinking,
.status-dot.typing {
    background: var(--color-primary);
    animation: statusPulse 1s ease-in-out infinite;
}

.status-text {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-gray);
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Install Button */
.install-button {
    display: none; /* shown via JS */
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--color-primary);
    background: var(--color-white);
    color: var(--color-primary);
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.install-button:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.install-button:active {
    transform: scale(0.96);
}

.install-button svg {
    flex-shrink: 0;
}

/* ---- Plants Button (Header) ---- */
.plants-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--color-primary);
    background: var(--color-white);
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.plants-button:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.plants-button:active {
    transform: scale(0.96);
}

/* ---- Plants List (Modal) ---- */
.plants-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.plants-empty {
    color: var(--color-gray);
    font-size: 0.9rem;
    text-align: center;
    padding: var(--space-lg) 0;
}

.plant-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-cream);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.plant-slot {
    flex-shrink: 0;
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--color-primary-faint);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 700;
}

.plant-info {
    flex: 1;
    min-width: 0;
}

.plant-name {
    font-weight: 600;
    color: var(--color-dark);
    font-size: 0.95rem;
}

.plant-status {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    margin-top: 2px;
}

.plant-status.growing { background: var(--color-primary-faint); color: var(--color-primary); }
.plant-status.ready { background: rgba(196, 105, 74, 0.12); color: var(--color-terracotta); }
.plant-status.harvested { background: rgba(0, 0, 0, 0.05); color: var(--color-gray); }

.plant-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.plant-action-btn {
    border: none;
    background: transparent;
    color: var(--color-gray);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.plant-action-btn:hover { background: var(--color-cream-dark); color: var(--color-dark); }
.plant-action-btn.danger:hover { background: rgba(231, 76, 60, 0.1); color: var(--color-error); }

/* ---- Add Plant Form ---- */
.add-plant-form {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-md);
}

.add-plant-form h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin: 0 0 var(--space-sm);
    color: var(--color-dark);
}

.add-plant-row {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.plant-input {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: var(--color-white);
}

.plant-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.plant-slot-input {
    flex: 0 0 80px;
}

/* ---- Chat Container ---- */
.chat-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-md);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding-bottom: var(--space-sm);
}

/* ---- Messages ---- */
.message {
    display: flex;
    gap: var(--space-sm);
    animation: messageIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 100%;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
}

/* Avatar */
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.message.assistant .message-avatar {
    background: var(--color-primary-faint);
}

.message.user .message-avatar {
    background: var(--color-cream-dark);
}

/* Message Content */
.message-content {
    max-width: 80%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.message.user .message-content {
    align-items: flex-end;
}

/* Message Bubbles */
.message-text {
    padding: 10px 14px;
    line-height: 1.5;
    font-size: 0.875rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: normal;
    min-width: 0;
    max-width: 100%;
}

/* Flora Bubbles — Moos-Grün (Relaunch 2026, statt altem Türkis) */
.message.assistant .message-text {
    background: #23381f;
    color: #e9e3cf;
    border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
    box-shadow: var(--shadow-sm);
}

/* User Bubbles — White with subtle moss border */
.message.user .message-text {
    background: var(--color-white);
    color: var(--color-dark);
    border: 1.5px solid rgba(35, 56, 31, 0.16);
    border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* Timestamp */
.message-time {
    font-size: 0.75rem;
    color: var(--color-gray-light);
    padding: 0 4px;
    font-weight: 500;
}

/* Kamera-Datenschutz-Hinweis (Relaunch 2026) */
.cam-hint {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-gray);
    text-align: center;
    margin-top: 5px;
}

/* Streaming cursor */
.message.streaming .message-text::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    background: rgba(255, 255, 255, 0.7);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 0.8s steps(2) infinite;
}

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

/* ---- Typing Indicator ---- */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0 var(--space-md);
}

.typing-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-primary-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--color-primary);
    padding: 12px 18px;
    border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ---- Input Container ---- */
.input-container {
    background: rgba(248, 246, 240, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--color-border);
    padding: var(--space-xs) var(--space-sm);
    padding-bottom: max(var(--space-sm), calc(var(--safe-bottom) + 4px));
    position: sticky;
    bottom: 0;
    z-index: 100;
    overflow: visible;
}

.input-wrapper {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

/* Voice Button */
.voice-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--color-white);
    color: var(--color-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.voice-button .mic-icon {
    transition: opacity 0.2s ease;
}

.voice-button .voice-waveform {
    display: none;
}

.voice-button:hover {
    background: var(--color-primary-faint);
    box-shadow: var(--shadow-md);
}

.voice-button:active {
    transform: scale(0.92);
}

/* Voice Button — Idle Glow */
.voice-button::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

/* Voice Button — Recording State */
.voice-button.recording {
    background: var(--color-white);
    color: var(--color-error);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
    animation: recordingPulse 1.5s ease-in-out infinite;
}

.voice-button.recording .mic-icon {
    opacity: 0;
}

.voice-button.recording .voice-waveform {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.voice-waveform span {
    display: block;
    width: 3px;
    height: 8px;
    background: var(--color-error);
    border-radius: 2px;
    animation: waveform 0.8s ease-in-out infinite;
}

.voice-waveform span:nth-child(1) { animation-delay: 0s; height: 6px; }
.voice-waveform span:nth-child(2) { animation-delay: 0.1s; height: 14px; }
.voice-waveform span:nth-child(3) { animation-delay: 0.2s; height: 10px; }
.voice-waveform span:nth-child(4) { animation-delay: 0.3s; height: 16px; }
.voice-waveform span:nth-child(5) { animation-delay: 0.15s; height: 8px; }

@keyframes waveform {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1.3); }
}

@keyframes recordingPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(231, 76, 60, 0.08);
    }
}

/* Text Input */
.message-input {
    flex: 1;
    min-width: 0; /* erlaubt dem Input zu schrumpfen — sonst drückt seine Eigenbreite den Senden-Button rechts raus */
    background: var(--color-white);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    color: var(--color-dark);
    font-family: var(--font-body);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 40px;
}

.message-input::placeholder {
    color: var(--color-gray-light);
}

.message-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-faint);
}

/* Send Button */
.send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    color: var(--color-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.send-button:hover {
    background: var(--color-primary-light);
    box-shadow: var(--shadow-md);
}

.send-button:active {
    transform: scale(0.92);
}

.send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ---- Audio Play Button (Fallback) ---- */
.audio-play-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-top: 8px;
    background: var(--color-white);
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audio-play-button:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.audio-play-button:active {
    transform: scale(0.96);
}

/* ---- Voice Indicator ---- */
.voice-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-white);
    animation: voiceIndicatorPulse 1.5s ease-in-out infinite;
}

@keyframes voiceIndicatorPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* ---- Loading Overlay ---- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(248, 246, 240, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-cream-dark);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--color-gray);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ---- Install Modal ---- */
.install-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.install-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 31, 31, 0.4);
    backdrop-filter: blur(4px);
}

.install-modal-content {
    position: relative;
    background: var(--color-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.install-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-lg) var(--space-md);
}

.install-modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-dark);
}

.install-modal-close {
    background: none;
    border: none;
    color: var(--color-gray);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.install-modal-close:hover {
    background: var(--color-cream);
    color: var(--color-dark);
}

.install-modal-body {
    padding: 0 var(--space-lg) var(--space-lg);
}

.install-subtitle {
    text-align: center;
    color: var(--color-gray);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
}

.platform-selection {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.platform-button {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-cream);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
}

.platform-button:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.platform-button:active {
    transform: translateY(0);
}

.platform-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.platform-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.platform-text strong {
    font-size: 0.9375rem;
    color: var(--color-dark);
}

.platform-text small {
    font-size: 0.8125rem;
    color: var(--color-gray);
}

.install-modal-footer {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
}

.later-button,
.never-button {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-gray);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
}

.later-button:hover,
.never-button:hover {
    background: var(--color-cream);
    color: var(--color-dark);
}

/* Platform Instructions */
.platform-instructions {
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.platform-instructions h4 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--color-dark);
}

.instruction-list {
    list-style: none;
    counter-reset: step-counter;
    padding: 0;
    margin-bottom: var(--space-lg);
}

.instruction-list li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 44px;
    margin-bottom: var(--space-lg);
    line-height: 1.6;
    color: var(--color-dark);
    font-size: 0.9375rem;
}

.instruction-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8125rem;
}

.instruction-list li strong {
    color: var(--color-dark);
    font-weight: 600;
}

.instruction-list li small {
    display: block;
    color: var(--color-gray);
    font-size: 0.8125rem;
    margin-top: 2px;
}

.instruction-highlight {
    display: inline-block;
    background: var(--color-primary-faint);
    color: var(--color-green-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 4px;
}

.share-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin: 0 2px;
    color: var(--color-primary);
}

.instruction-note {
    background: var(--color-primary-faint);
    border-left: 3px solid var(--color-primary);
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-dark);
}

.back-button {
    width: 100%;
    padding: 12px;
    background: var(--color-cream);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
}

.back-button:hover {
    border-color: var(--color-primary);
}

/* ---- Splash Overlay (disabled but keep styles) ---- */
.splash-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.splash-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* ---- Scrollbar ---- */
.chat-container::-webkit-scrollbar {
    width: 4px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ---- Desktop ---- */
@media (min-width: 768px) {
    html {
        font-size: 16px;
    }

    .app-container {
        max-width: 480px;
        margin: 0 auto;
        border-left: 1px solid var(--color-border);
        border-right: 1px solid var(--color-border);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.04);
    }

    .install-modal {
        align-items: center;
    }

    .install-modal-content {
        border-radius: var(--radius-lg);
    }
}

/* ---- Small screens ---- */
@media (max-width: 374px) {
    .message-content {
        max-width: 90%;
    }

    .header-device-id {
        display: none;
    }
}

/* ---- Accessibility: Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .botanical-blob {
        display: none;
    }
}

/* ---- Page Load Animation ---- */
.app-container {
    animation: pageLoad 0.5s ease-out;
}

@keyframes pageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ---- Action Bar (Mic + Camera) ---- */
.input-row {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow: visible;
  max-width: 100%;
}

.action-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 4px;
  padding-top: 4px;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 110px;
  height: 36px;
  padding: 0 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 9999px;
  background: #ffffff;
  color: #2d3436;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  justify-content: center;
}

.action-button:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px var(--color-primary-faint);
}

.action-button:active {
  transform: scale(0.95);
}

.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.voice-action {
  color: var(--color-primary);
}

.camera-action {
  color: var(--color-primary);
}

.action-label {
  pointer-events: none;
}

/* Recording State */
.voice-action.recording {
  background: rgba(231, 76, 60, 0.08);
  border-color: #e74c3c;
  color: #e74c3c;
  animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: #e74c3c; }
  50% { border-color: rgba(231, 76, 60, 0.4); }
}

.voice-action.recording .mic-icon {
  display: none;
}

.voice-action.recording .voice-waveform {
  display: flex;
}

/* Responsive: Kleine Screens */
@media (max-width: 374px) {
  .action-button {
    min-width: 120px;
    padding: 0 14px;
    font-size: 0.85rem;
  }
}

/* Fix: Waveform im neuen Action-Button ausblenden */
.voice-action .voice-waveform {
  display: none;
}

/* ==========================================
   PLANTS TAB — Journeys + Tower-Pflege + Consent (Etappe 5)
   Neues homegarden.bio-Design · Mockup Screen 3
   ========================================== */

/* Plants-View fuellt den Raum zwischen Header und Tab-Bar */
.plants-view {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plants-view__head { padding: 6px 2px 2px; }
.plants-view__eyebrow {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--color-green-mid);
  display: inline-flex; align-items: center; gap: 9px;
}
.plants-view__eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--color-green-mid); }
.plants-view__head h2 {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: 2rem; margin-top: 7px; letter-spacing: -.02em; color: var(--color-dark);
}

.plants-section-label {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--color-gray); margin: 8px 2px 0;
}

/* Pflanzen-/Journey-Karte */
.plant-card {
  background: rgba(255, 255, 255, .6); border: 1px solid var(--color-border);
  border-radius: 18px; padding: 16px;
}
.plant-card__top { display: flex; align-items: center; gap: 12px; }
.plant-card__emoji {
  width: 46px; height: 46px; border-radius: 13px; background: var(--color-accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0;
}
.plant-card__title {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: 1.2rem; color: var(--color-dark); line-height: 1.05;
}
.plant-card__meta {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--color-gray); display: block; margin-top: 3px;
}
.plant-card__stage {
  margin-left: auto; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--color-cream); background: var(--color-primary);
  padding: 6px 11px; border-radius: var(--radius-full); white-space: nowrap;
}

/* Journey-Timeline */
.timeline { display: flex; align-items: flex-start; margin-top: 18px; padding: 0 2px; }
.tl-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; position: relative; }
.tl-dot {
  width: 22px; height: 22px; border-radius: 50%; background: var(--color-bone-deep);
  display: flex; align-items: center; justify-content: center; font-size: .62rem;
  color: var(--color-gray); z-index: 2; border: 1px solid var(--color-border);
}
.tl-step.done .tl-dot { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-cream); }
.tl-step.now .tl-dot { background: #fff; border-color: var(--color-accent); color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.tl-lbl { font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-gray); text-align: center; }
.tl-step.now .tl-lbl { color: var(--color-accent); }
.tl-line { position: absolute; top: 10px; left: 50%; width: 100%; height: 1px; background: var(--color-border); z-index: 1; }
.tl-step.done .tl-line { background: var(--color-primary); }
.tl-step:last-child .tl-line { display: none; }

.next-hint {
  margin-top: 15px; font-family: var(--font-body); font-size: .8rem; color: var(--color-dark);
  background: var(--color-cream-dark); border-radius: 11px; padding: 11px 13px; line-height: 1.45;
}
.next-hint .k {
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--color-accent); display: block; margin-bottom: 3px;
}

/* Tower-Pflege-Karte */
.tower-card {
  background: rgba(255, 255, 255, .6); border: 1px solid var(--color-border);
  border-radius: 18px; padding: 8px 16px 14px;
}
.tower-card__head { padding-top: 8px; }
.tower-card__eyebrow {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--color-green-mid);
}
.tower-card__title { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 1.15rem; color: var(--color-dark); margin-top: 4px; }
.tower-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--color-border); }
.tower-row__ic { width: 38px; height: 38px; border-radius: 11px; background: var(--color-accent-soft); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.tower-row__txt strong { font-family: var(--font-body); font-weight: 600; font-size: .88rem; color: var(--color-dark); display: block; }
.tower-row__txt span { font-family: var(--font-body); font-size: .76rem; color: var(--color-gray); display: block; margin-top: 2px; line-height: 1.4; }
.tower-row__when { margin-left: auto; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-green-mid); white-space: nowrap; }
.tower-row__when.due { color: var(--color-accent); }

/* Consent-Karte (dunkles Moos) */
.consent-card {
  background: var(--color-green-dark); color: var(--color-cream);
  border: 1px solid rgba(255, 255, 255, .06); border-radius: 18px; padding: 18px;
  position: relative; overflow: hidden;
}
.consent-card__glow { position: absolute; inset: 0; background: radial-gradient(220px 160px at 100% 0, var(--color-accent-soft), transparent 60%); pointer-events: none; }
.consent-card__eyebrow {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--color-accent); display: inline-flex; align-items: center; gap: 9px; position: relative;
}
.consent-card__eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--color-accent); }
.consent-card h3 { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 1.25rem; position: relative; margin-top: 7px; }
.consent-card p { font-family: var(--font-body); font-size: .78rem; color: rgba(244, 239, 228, .66); margin-top: 7px; line-height: 1.5; position: relative; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; position: relative; }
.toggle-row__lbl { font-family: var(--font-body); font-size: .86rem; font-weight: 600; }
.toggle-row__lbl small { display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .04em; font-weight: 400; color: rgba(244, 239, 228, .5); margin-top: 3px; text-transform: none; }
/* Toggle-Schalter */
.tog { width: 48px; height: 28px; border-radius: var(--radius-full); background: rgba(244, 239, 228, .22); position: relative; flex-shrink: 0; border: none; cursor: pointer; transition: background .25s ease; padding: 0; }
.tog::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--color-cream); transition: transform .25s ease; }
.tog.on { background: var(--color-accent); }
.tog.on::after { transform: translateX(20px); }
.tog:disabled { opacity: .5; cursor: progress; }
.quiet-line { margin-top: 14px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: rgba(244, 239, 228, .45); position: relative; }
.consent-card__legal { margin-top: 12px; font-family: var(--font-body); font-size: .68rem; color: rgba(244, 239, 228, .42); line-height: 1.45; position: relative; }
.consent-card__legal a { color: rgba(244, 239, 228, .7); }

/* Empty-States */
.plants-empty {
  font-family: var(--font-body); font-size: .85rem; color: var(--color-gray);
  text-align: center; padding: 20px 16px; line-height: 1.5;
  background: rgba(255, 255, 255, .4); border: 1px dashed var(--color-border); border-radius: 14px;
}

/* Inventar-Zeilen (Pflanzen ohne Journey) */
.inv-row { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .55); border: 1px solid var(--color-border); border-radius: 14px; padding: 11px 13px; }
.inv-row__slot { width: 30px; height: 30px; border-radius: 9px; background: var(--color-primary); color: var(--color-cream); font-family: var(--font-mono); font-size: .8rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.inv-row__name { font-family: var(--font-body); font-weight: 600; font-size: .9rem; color: var(--color-dark); }
.inv-row__status { font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-gray); display: block; margin-top: 1px; }
.inv-row__actions { margin-left: auto; display: flex; gap: 6px; }
.inv-btn { border: 1px solid var(--color-border); background: rgba(255, 255, 255, .6); color: var(--color-primary); font-family: var(--font-mono); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; border-radius: 8px; cursor: pointer; }
.inv-btn.danger { color: var(--color-error); }

/* Pflanze hinzufuegen */
.add-plant { display: flex; gap: 8px; margin-top: 4px; }
.add-plant input { flex: 1; border: 1px solid var(--color-border); background: #fff; border-radius: 10px; padding: 11px 13px; font-family: var(--font-body); font-size: .86rem; color: var(--color-dark); outline: none; min-width: 0; }
.add-plant input.slot { max-width: 78px; text-align: center; font-family: var(--font-mono); }
.add-plant input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.add-plant button { border: none; background: var(--color-primary); color: var(--color-cream); border-radius: 10px; padding: 0 16px; font-family: var(--font-body); font-weight: 600; font-size: .86rem; cursor: pointer; flex-shrink: 0; }
.add-plant button:disabled { opacity: .6; cursor: progress; }

.plants-error { font-family: var(--font-body); font-size: .8rem; color: var(--color-error); padding: 6px 2px; }

/* Tab-Bar (Chat / Pflanzen) */
.tab-bar {
  display: flex; border-top: 1px solid var(--color-border);
  background: rgba(248, 246, 240, .9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 5px 6px; padding-bottom: max(6px, calc(var(--safe-bottom) + 3px));
  position: sticky; bottom: 0; z-index: 100;
}
.tab-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer; padding: 2px;
  font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--color-gray); transition: color .2s ease;
}
.tab-btn svg { width: 18px; height: 18px; }
.tab-btn.active { color: var(--color-primary); }

/* ==========================================
   ZUM HOME-BILDSCHIRM HINZUFÜGEN (Etappe-5-Feinschliff)
   Verknüpfung, kein App-Store-Install — bricht das „keine App"-Versprechen nicht.
   ========================================== */

/* Tipp auf dem Success-Screen */
.a2hs-tip {
  margin-top: 18px; width: 100%;
  background: rgba(255, 255, 255, .5); border: 1px solid var(--color-border);
  border-radius: 14px; padding: 14px; text-align: center;
}
.a2hs-tip__txt { font-family: var(--font-body); font-size: .84rem; color: var(--color-dark); line-height: 1.45; margin-bottom: 10px; }
.a2hs-btn {
  width: 100%; border: none; cursor: pointer; background: var(--color-accent); color: #fff;
  font-family: var(--font-body); font-weight: 600; font-size: .9rem; padding: 12px; border-radius: 10px;
  transition: transform .15s ease, background .2s ease;
}
.a2hs-btn:active { transform: scale(.98); }

/* Dezenter Banner im Chat (Fallback) */
.a2hs-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px;
  background: var(--color-cream-dark); border-bottom: 1px solid var(--color-border);
}
.a2hs-banner__txt { flex: 1; min-width: 0; font-family: var(--font-body); font-size: .78rem; color: var(--color-dark); line-height: 1.35; }
.a2hs-banner__add {
  flex-shrink: 0; border: none; cursor: pointer; background: var(--color-primary); color: var(--color-cream);
  font-family: var(--font-body); font-weight: 600; font-size: .76rem; padding: 8px 12px; border-radius: 8px;
}
.a2hs-banner__close { flex-shrink: 0; border: none; background: none; cursor: pointer; color: var(--color-gray); font-size: 1.3rem; line-height: 1; padding: 2px 6px; }

/* iOS-/Fallback-Anleitung (Bottom-Sheet) */
.a2hs-sheet {
  position: fixed; inset: 0; z-index: 300; background: rgba(21, 36, 28, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.a2hs-sheet__card {
  background: var(--color-cream); width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0; padding: 22px 20px calc(22px + var(--safe-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
}
.a2hs-sheet__card h3 { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 1.4rem; color: var(--color-dark); margin-bottom: 6px; }
.a2hs-sheet__card > p { font-family: var(--font-body); font-size: .86rem; color: var(--color-gray); line-height: 1.5; margin-bottom: 16px; }
.a2hs-sheet__steps { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 0 0 18px; }
.a2hs-sheet__steps li { display: flex; align-items: center; gap: 12px; font-family: var(--font-body); font-size: .9rem; color: var(--color-dark); line-height: 1.4; }
.a2hs-sheet__num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--color-primary); color: var(--color-cream); font-family: var(--font-mono); font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.a2hs-sheet__close { width: 100%; border: none; cursor: pointer; background: var(--color-primary); color: var(--color-cream); font-family: var(--font-body); font-weight: 600; font-size: .92rem; padding: 13px; border-radius: 10px; }
/* Link-kopieren im WebView-Abfang (Etappe 1 PWA-Ausbau, 2026-07-12): Hauptaktion
   im In-App-Fall — deshalb gefuellt; "Verstanden" wird dort zur Zweitaktion. */
.a2hs-sheet__copy { margin: 0 0 10px; }
.a2hs-sheet__copybtn { width: 100%; border: 2px solid var(--color-primary); cursor: pointer; background: var(--color-primary); color: var(--color-cream); font-family: var(--font-body); font-weight: 600; font-size: .92rem; padding: 12px; border-radius: 10px; }
.a2hs-sheet__copydone { font-family: var(--font-body); font-size: .82rem; color: var(--color-primary); text-align: center; margin-top: 8px; }
.a2hs-sheet__linkfield { width: 100%; padding: 12px; font-family: var(--font-mono); font-size: .82rem; color: var(--color-dark); background: #fff; border: 2px solid var(--color-primary); border-radius: 10px; }
.a2hs-sheet--inapp .a2hs-sheet__close { background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary); }

/* Flora-Avatar entfernt — die dunkelgrüne Bubble kennzeichnet Flora bereits (Harald, 2026-06-07).
   Deckt Welcome-Message, dynamische Antworten und Typing-Indikator ab. */
.message-avatar, .typing-avatar { display: none; }

/* ==========================================
   QR-SCANNER (In-App, Onboarding)
   ========================================== */
.scan-card { cursor: pointer; }
.qr-scanner {
  position: fixed; inset: 0; z-index: 400; background: #0d140f;
  display: flex; flex-direction: column;
}
.qr-scanner__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, calc(var(--safe-top) + 8px)) 18px 12px; color: var(--color-cream);
}
.qr-scanner__title { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.qr-scanner__close { background: none; border: none; color: var(--color-cream); font-size: 1.9rem; line-height: 1; cursor: pointer; padding: 0 6px; }
.qr-scanner__stage { position: relative; flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.qr-scanner__video { width: 100%; height: 100%; object-fit: cover; }
.qr-scanner__frame {
  position: absolute; width: 64vw; max-width: 280px; aspect-ratio: 1 / 1;
  border: 2px solid rgba(244, 239, 228, .92); border-radius: 24px;
  box-shadow: 0 0 0 100vmax rgba(13, 20, 15, .55);
}
.qr-scanner__hint {
  color: var(--color-cream); text-align: center; font-family: var(--font-body); font-size: .86rem;
  padding: 16px 24px calc(20px + var(--safe-bottom)); line-height: 1.45; background: #0d140f;
}
.qr-scanner__hint.error { color: #f0b8a8; }
