* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0f1720;
    --panel: #17212b;
    --panel-2: #1e2a36;
    --accent: #4f9dde;
    --accent-2: #2b8a3e;
    --danger: #e03131;
    --text: #e6edf3;
    --muted: #8aa0b3;
    --bubble-me: #2b6cb0;
    --bubble-you: #2a3946;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 16px;
}

.app {
    width: 100%;
    max-width: 720px;
    background: var(--panel);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--panel-2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

.status {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.status--off {
    background: rgba(224, 49, 49, 0.15);
    color: #ff8787;
}

.status--wait {
    background: rgba(224, 169, 49, 0.15);
    color: #ffd43b;
}

.status--on {
    background: rgba(43, 138, 62, 0.2);
    color: #69db7c;
}

.setup {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.setup__intro p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.setup__roles {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.flow {
    background: var(--panel-2);
    border-radius: 10px;
    padding: 18px;
}

.flow h2 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--accent);
}

.steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.steps li p {
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.code {
    width: 100%;
    min-height: 90px;
    resize: vertical;
    background: var(--bg);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.78rem;
    margin-bottom: 8px;
    word-break: break-all;
}

.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    transition: transform 0.05s ease, opacity 0.2s ease;
}

.btn:hover {
    opacity: 0.9;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--accent);
}

.btn--secondary {
    background: var(--panel);
    border: 1px solid var(--accent);
}

.btn--danger {
    background: var(--danger);
}

.btn--small {
    padding: 7px 12px;
    font-size: 0.82rem;
    background: var(--accent);
}

.chat {
    display: flex;
    flex-direction: column;
    height: 480px;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bubble {
    max-width: 75%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.bubble--me {
    align-self: flex-end;
    background: var(--bubble-me);
    border-bottom-right-radius: 4px;
}

.bubble--you {
    align-self: flex-start;
    background: var(--bubble-you);
    border-bottom-left-radius: 4px;
}

.bubble--sys {
    align-self: center;
    background: transparent;
    color: var(--muted);
    font-size: 0.8rem;
    font-style: italic;
}

.bubble__time {
    display: block;
    font-size: 0.68rem;
    opacity: 0.6;
    margin-top: 3px;
}

.chat__form {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--panel-2);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chat__input {
    flex: 1;
    background: var(--bg);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.95rem;
}

.chat__input:focus {
    outline: none;
    border-color: var(--accent);
}

.hidden {
    display: none !important;
}

/* Fachada pública "Hello World". */
.facade {
    min-height: calc(100vh - 32px);
    /* descuenta el padding de 16px del body */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}