/* Chat: tema scuro, colonna sinistra commentata (solo topbar + contenuto) */
.siq-shell {
    display: block;
    min-height: 78vh;
    background: #0f172a;
    color: #e2e8f0;
}

/* Sidebar disattivata – niente storico per ora
.siq-sidebar { ... }
*/
.siq-sidebar {
    display: none;
}

.siq-main {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 78vh;
}

.siq-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid #334155;
}

.siq-topbar strong { color: #f8fafc; }
.siq-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.siq-topbar-profile-link {
    color: #94a3b8;
    font-size: 0.875rem;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.siq-topbar-profile-link:hover {
    color: #e2e8f0;
    background: rgba(51, 65, 85, 0.5);
}

.siq-muted {
    color: #94a3b8;
    font-size: 14px;
}

.siq-messages {
    padding: 24px;
    overflow: auto;
    background: #0f172a;
}

.siq-msg {
    max-width: 760px;
    padding: 14px 16px;
    border-radius: 18px;
    margin-bottom: 14px;
    white-space: pre-wrap;
    font: 400 15px/1.55 system-ui, sans-serif;
}

.siq-msg-user {
    margin-left: auto;
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid #334155;
}

.siq-msg-assistant {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
}
.siq-msg-error {
    border-color: #dc2626;
    background: rgba(30, 41, 59, 0.9);
    color: #fca5a5;
}

.siq-composer {
    display: grid;
    grid-template-columns: 1fr minmax(90px, auto);
    gap: 12px;
    align-items: flex-end;
    padding: 16px;
    border-top: 1px solid #334155;
    background: #0f172a;
}

.siq-composer .siq-btn-primary { min-width: 90px; flex-shrink: 0; }

.siq-composer textarea {
    width: 100%;
    min-height: 72px;
    resize: vertical;
    padding: 14px;
    border: 1px solid #334155;
    border-radius: 14px;
    background: #1e293b;
    color: #f1f5f9;
    font: 400 15px/1.4 system-ui, sans-serif;
}

.siq-btn-primary,
.siq-btn-secondary {
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font: 600 14px/1 system-ui, sans-serif;
    cursor: pointer;
}

.siq-btn-primary {
    background: #3b82f6;
    color: #fff;
}

.siq-btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

.siq-gate {
    padding: 24px;
    border: 1px solid #334155;
    border-radius: 16px;
    background: #1e293b;
    color: #e2e8f0;
}

/* Profilo: griglia centrata */
.siq-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 32px;
    max-width: 560px;
    margin: 0 auto;
}

.siq-profile-grid label {
    display: grid;
    gap: 8px;
    font: 600 14px/1.3 system-ui, sans-serif;
    color: #e2e8f0;
}

.siq-profile-grid input,
.siq-profile-grid select {
    padding: 12px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: #1e293b;
    color: #f1f5f9;
}

.siq-span-2 {
    grid-column: 1 / -1;
}

/* Checkbox custom profilo: allineate e stilizzate */
.siq-checkbox-row {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}
.siq-profile-grid .siq-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    grid-gap: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
}
.siq-checkbox-input {
    position: absolute;
    width: 20px;
    height: 20px;
    margin: 0;
    opacity: 0;
}
.siq-checkbox-box {
    position: relative;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2px solid #334155;
    border-radius: 6px;
    background: #1e293b;
    transition: border-color 0.2s, background 0.2s;
}
.siq-checkbox-input:focus-visible + .siq-checkbox-box {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
.siq-checkbox-input:checked + .siq-checkbox-box {
    background: #3b82f6;
    border-color: #3b82f6;
}
.siq-checkbox-input:checked + .siq-checkbox-box::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.siq-checkbox-text {
    color: #e2e8f0;
}

/* Tema scuro in app shell (pagina profilo/chat) */
.siq-app-shell .siq-profile-grid label { color: #e2e8f0; }
.siq-app-shell .siq-profile-grid input,
.siq-app-shell .siq-profile-grid select {
    border-color: #334155;
    background: #1e293b;
    color: #f1f5f9;
}
.siq-app-shell .siq-muted { color: #94a3b8; }

/* Desktop: chat non full width */
@media (min-width: 1024px) {
    .siq-shell {
        max-width: 820px;
        margin-left: auto;
        margin-right: auto;
        min-height: 80vh;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    }
}

@media (max-width: 900px) {
    .siq-profile-grid {
        grid-template-columns: 1fr;
    }
}