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

:root {
    --background: #050505;
    --panel: #101010;
    --panel-light: #151515;
    --green: #7cfc00;
    --bright-green: #00ff66;
    --soft-green: #99ff99;
    --border: rgba(0, 255, 102, 0.55);
    --muted: #8a8a8a;
    --white: #f3f3f3;
    --danger: #ff6961;
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at top, #111 0, #050505 45%),
        var(--background);

    color: var(--green);
    font-family: Consolas, Monaco, "Courier New", monospace;
    line-height: 1.6;
    min-height: 100vh;
}

button,
textarea {
    font: inherit;
}

.container {
    width: min(95%, 1500px);
    margin: 0 auto;
    padding: 30px 0 50px;
}

.site-header {
    padding: 20px 10px 35px;
    text-align: center;
}

.eyebrow {
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

h1 {
    color: var(--green);
    font-size: clamp(3rem, 8vw, 5rem);
    line-height: 1;
    text-shadow:
        0 0 10px var(--bright-green),
        0 0 24px rgba(0, 255, 102, 0.7);
}

h2 {
    color: var(--soft-green);
    margin-top: 12px;
}

h3 {
    border-bottom: 1px solid var(--border);
    color: var(--green);
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.header-message {
    color: var(--white);
    margin: 18px auto 0;
    max-width: 700px;
}

.top-grid,
.dashboard-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.panel {
    background: linear-gradient(145deg, var(--panel-light), var(--panel));
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 0 16px rgba(0, 255, 102, 0.13);
    padding: 24px;
}

.compact-panel {
    min-height: 190px;
}

.compact-panel p {
    margin: 7px 0;
}

.status-dot {
    background: var(--bright-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--bright-green);
    display: inline-block;
    height: 8px;
    margin-right: 8px;
    width: 8px;
}

.clock {
    color: var(--bright-green);
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 700;
}

.mood {
    color: var(--bright-green);
    font-size: 1.8rem;
    font-weight: 700;
}

#mood-detail {
    color: var(--muted);
}

.hero-section {
    margin: 34px 0;
}

.hero {
    border: 2px solid var(--bright-green);
    border-radius: 16px;
    box-shadow:
        0 0 20px var(--bright-green),
        0 0 60px rgba(0, 255, 102, 0.14);
    display: block;
    max-height: 720px;
    object-fit: cover;
    width: 100%;
}

.quote {
    background: rgba(16, 16, 16, 0.96);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.2);
    color: var(--white);
    font-size: 1.2rem;
    margin: -35px auto 0;
    max-width: 900px;
    padding: 20px;
    position: relative;
    text-align: center;
    width: calc(100% - 40px);
}

.cursor::after {
    animation: blink 1s infinite;
    content: "_";
}

.chat-panel {
    margin: 40px 0;
    padding: 0;
    overflow: hidden;
}

.chat-header {
    align-items: center;
    background: rgba(0, 255, 102, 0.04);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 20px;
    justify-content: space-between;
    padding: 24px;
}

.chat-header h3 {
    border: 0;
    font-size: 1.5rem;
    margin: 0;
    padding: 0;
}

.chat-subtitle {
    color: var(--muted);
    margin-top: 8px;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: min(60vh, 650px);
    min-height: 400px;
    overflow-y: auto;
    padding: 25px;
}

.chat-empty-state {
    color: var(--muted);
    margin: auto;
    max-width: 600px;
    text-align: center;
}

.message-row {
    display: flex;
}

.message-row.user {
    justify-content: flex-end;
}

.message-row.assistant {
    justify-content: flex-start;
}

.message-bubble {
    border-radius: 12px;
    max-width: min(82%, 850px);
    padding: 14px 17px;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-row.user .message-bubble {
    background: var(--bright-green);
    color: #050505;
}

.message-row.assistant .message-bubble {
    background: #171717;
    border: 1px solid var(--border);
    color: var(--white);
}

.message-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 5px;
    opacity: 0.75;
    text-transform: uppercase;
}

.typing-indicator {
    border-top: 1px solid #222;
    color: var(--soft-green);
    padding: 12px 25px;
}

.chat-form {
    align-items: stretch;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr auto;
    padding: 20px;
}

.chat-form textarea {
    background: #090909;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--white);
    min-height: 62px;
    outline: none;
    padding: 14px;
    resize: vertical;
}

.chat-form textarea:focus {
    border-color: var(--bright-green);
    box-shadow: 0 0 8px rgba(0, 255, 102, 0.35);
}

button {
    background: #101010;
    border: 1px solid var(--bright-green);
    border-radius: 8px;
    color: var(--green);
    cursor: pointer;
    padding: 12px 20px;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        opacity 0.2s ease;
}

button:hover {
    background: var(--bright-green);
    color: #050505;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.secondary-button {
    white-space: nowrap;
}

.chat-footer {
    border-top: 1px solid #222;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.78rem;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 20px;
}

.chat-footer code {
    color: var(--soft-green);
}

.dashboard-grid {
    margin-top: 30px;
}

.dashboard-grid .panel p {
    margin: 12px 0;
}

.success-text {
    color: var(--bright-green);
    font-weight: 700;
}

progress {
    accent-color: var(--bright-green);
    height: 16px;
    width: 100%;
}

hr {
    border: 0;
    border-top: 1px solid #282828;
    margin: 18px 0;
}

footer {
    color: #777;
    margin-top: 60px;
    text-align: center;
}

footer p {
    margin: 8px;
}

a {
    color: var(--green);
    text-decoration: none;
}

a:hover {
    color: var(--white);
}

.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #111;
}

::-webkit-scrollbar-thumb {
    background: #007a32;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bright-green);
}

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

    51%,
    100% {
        opacity: 0;
    }
}

@media (max-width: 700px) {
    .container {
        padding-top: 15px;
    }

    .chat-header {
        align-items: stretch;
        flex-direction: column;
    }

    .chat-form {
        grid-template-columns: 1fr;
    }

    .chat-messages {
        height: 55vh;
        min-height: 350px;
        padding: 16px;
    }

    .message-bubble {
        max-width: 92%;
    }

    .secondary-button {
        width: 100%;
    }
}


/* =========================================================
   Nibbler Mobile Chat Mode v1
   ========================================================= */

.chat-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.exit-chat-button {
    display: none;
}

@media (max-width: 700px) {

    body.nibbler-mobile-chat-open {
        overflow: hidden;
    }

    body.nibbler-mobile-chat-open .chat-panel {
        position: fixed;
        inset: 0;
        z-index: 10000;

        width: 100%;
        height: 100vh;
        height: 100dvh;

        margin: 0;
        padding: 0;

        display: flex;
        flex-direction: column;

        border: 0;
        border-radius: 0;
        background: var(--black);
    }

    body.nibbler-mobile-chat-open .chat-header {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;

        gap: 10px;
        padding: 12px 14px;
    }

    body.nibbler-mobile-chat-open .chat-header > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }

    body.nibbler-mobile-chat-open .chat-header h3 {
        font-size: 1.05rem;
    }

    body.nibbler-mobile-chat-open .chat-header .eyebrow {
        font-size: .68rem;
    }

    body.nibbler-mobile-chat-open .chat-subtitle {
        margin-top: 4px;
        font-size: .72rem;
    }

    body.nibbler-mobile-chat-open .chat-header-actions {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    body.nibbler-mobile-chat-open .chat-header-actions button {
        width: auto;
        margin: 0;
        padding: 7px 9px;
        font-size: .72rem;
        white-space: nowrap;
    }

    body.nibbler-mobile-chat-open .exit-chat-button {
        display: block;
    }

    body.nibbler-mobile-chat-open .chat-messages {
        flex: 1 1 auto;

        height: auto;
        min-height: 0;

        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;

        padding: 16px 12px;
    }

    body.nibbler-mobile-chat-open .message-bubble {
        max-width: 94%;
    }

    body.nibbler-mobile-chat-open .typing-indicator {
        flex: 0 0 auto;
        padding: 8px 12px;
        font-size: .78rem;
    }

    body.nibbler-mobile-chat-open .chat-form {
        flex: 0 0 auto;

        display: grid;
        grid-template-columns: 1fr auto;

        gap: 8px;
        padding: 10px 12px;

        background: #090909;
    }

    body.nibbler-mobile-chat-open .chat-form textarea {
        min-width: 0;
        min-height: 48px;
        max-height: 110px;
        resize: none;
    }

    body.nibbler-mobile-chat-open #send-button {
        min-width: 72px;
        min-height: 48px;
        padding: 0 14px;
    }

    body.nibbler-mobile-chat-open .chat-footer {
        flex: 0 0 auto;
        padding: 7px 12px 9px;
        font-size: .68rem;
    }

    body.nibbler-mobile-chat-open .chat-footer span:first-child {
        display: none;
    }
}

/* =========================================================
   Nibbler Mobile Chat Header Fix v1
   ========================================================= */

@media (max-width: 700px) {

    body.nibbler-mobile-chat-open .chat-panel {
        background: #050505;
    }

    body.nibbler-mobile-chat-open .chat-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;

        background: #080808;
        padding: 12px 14px;
    }

    body.nibbler-mobile-chat-open .chat-header > div:first-child {
        width: 100%;
        min-width: 0;
    }

    body.nibbler-mobile-chat-open .chat-header .eyebrow {
        margin: 0 0 4px;
        font-size: .65rem;
    }

    body.nibbler-mobile-chat-open .chat-header h3 {
        margin: 0;
        font-size: 1.05rem;
        line-height: 1.2;
    }

    body.nibbler-mobile-chat-open .chat-subtitle {
        margin: 5px 0 0;
        font-size: .72rem;
        line-height: 1.2;
    }

    body.nibbler-mobile-chat-open .chat-header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
    }

    body.nibbler-mobile-chat-open .chat-header-actions button {
        width: 100%;
        min-height: 42px;
        margin: 0;
        padding: 8px 10px;
    }

    body.nibbler-mobile-chat-open .exit-chat-button {
        min-width: 72px;
    }

    body.nibbler-mobile-chat-open .chat-messages,
    body.nibbler-mobile-chat-open .typing-indicator,
    body.nibbler-mobile-chat-open .chat-form,
    body.nibbler-mobile-chat-open .chat-footer {
        background: #050505;
    }
}


/* =========================================================
   Nibbler Voice + Live Cam
   ========================================================= */

.nibbler-chat-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.nibbler-chat-title {
    min-width: 0;
}

.nibbler-chat-avatar {
    position: relative;

    width: 46px;
    height: 46px;
    flex: 0 0 46px;

    display: grid;
    place-items: center;

    overflow: hidden;

    border: 1px solid rgba(214, 168, 82, .6);
    border-radius: 50%;

    background: #111;
    color: #d6a852;

    font-weight: 900;
}

.nibbler-avatar-letter {
    display: none;
    width: 100%;
    height: 100%;

    place-items: center;

    color: #d6a852;
    font-size: 1rem;
    font-weight: 900;
}

.nibbler-avatar-cam {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
    object-position: center;

    border-radius: inherit;
}

.nibbler-chat-avatar.is-live {
    width: 120px;
    height: 120px;
    flex-basis: 120px;

    border-radius: 12px;
}

.nibbler-chat-avatar.is-live .nibbler-avatar-letter {
    display: none;
}

.nibbler-chat-avatar.is-live .nibbler-avatar-cam {
    display: block;
}

#nibbler-voice-toggle.voice-on {
    border-color: #d6a852;
    color: #d6a852;
}

@media (max-width: 700px) {

    .nibbler-chat-identity {
        width: 100%;
    }

    .nibbler-chat-avatar.is-live {
        width: 88px;
        height: 88px;
        flex-basis: 88px;
    }

    body.nibbler-mobile-chat-open
    .nibbler-chat-identity {
        display: flex;
        flex-direction: row;
        align-items: center;
    }
}
